Difference between revisions of "Sound.mix"

From MiniScript Wiki
Jump to navigation Jump to search
(Created page with "<c>Sound.mix</c> mixes another synthesized sound into this one, producing a more complex sound. === Arguments === {| class="wikitable" |- ! Parameter Name !! Type !! De...")
 
 
(One intermediate revision by one other user not shown)
Line 1: Line 1:
 
<c>[[Sound]].mix</c> mixes another synthesized sound into this one, producing a more
 
<c>[[Sound]].mix</c> mixes another synthesized sound into this one, producing a more
 
complex sound.
 
complex sound.
 
  
 
=== Arguments ===
 
=== Arguments ===
Line 17: Line 16:
  
 
<ms>daDing = new Sound
 
<ms>daDing = new Sound
// daDing.init 0.5, noteFreq(72), [1, 1, 0]
+
daDing.init 0.5, noteFreq(72), [1, 1, 0]
// dd2 = new Sound
+
dd2 = new Sound
// dd2.init 0.5, noteFreq(84), [0]*40 + range(1, 0, -0.01)
+
dd2.init 0.5, noteFreq(84), [0]*40 + range(1, 0, -0.01)
// daDing.mix dd2
+
daDing.mix dd2
// daDing.play</ms>
+
daDing.play</ms>
  
 
[[Category:Mini Micro]]
 
[[Category:Mini Micro]]

Latest revision as of 15:15, 2 April 2020

Sound.mix mixes another synthesized sound into this one, producing a more complex sound.

Arguments

Parameter Name Type Default Value Meaning
sound Sound Object Other sound (already prepared with sound.init) to mix in
level number 1 volume of other mixed-in sound relative to this one

Example

daDing = new Sound
daDing.init 0.5, noteFreq(72), [1, 1, 0]
dd2 = new Sound
dd2.init 0.5, noteFreq(84), [0]*40 + range(1, 0, -0.01)
daDing.mix dd2
daDing.play