mention crackle in the documentation
This commit is contained in:
@ -18,17 +18,19 @@ ${makeExample(
|
|||||||
beat(.5) && snd(['sine', 'triangle', 'sawtooth', 'square'].beat()).freq(100).out()
|
beat(.5) && snd(['sine', 'triangle', 'sawtooth', 'square'].beat()).freq(100).out()
|
||||||
`,
|
`,
|
||||||
true,
|
true,
|
||||||
)}
|
)}
|
||||||
|
|
||||||
Note that you can also use noise if you do not want to use a periodic oscillator:
|
Note that you can also use noise if you do not want to use a periodic oscillator:
|
||||||
|
|
||||||
${makeExample(
|
${makeExample(
|
||||||
"Listening to the different types of noise",
|
"Listening to the different types of noise",
|
||||||
`
|
`
|
||||||
beat(.5) && snd(['brown', 'pink', 'white'].beat()).adsr(0,.1,0,0).out()
|
beat(.5) && snd(['brown', 'pink', 'white', 'crackle'].beat()).adsr(0,.1,0,0).out()
|
||||||
`,
|
`,
|
||||||
true,
|
true,
|
||||||
)}
|
)}
|
||||||
|
|
||||||
|
The <ic>crackle</ic> type can be controlled using the <ic>density</ic> parameter.
|
||||||
|
|
||||||
Two functions are primarily used to control the frequency of the synthesizer:
|
Two functions are primarily used to control the frequency of the synthesizer:
|
||||||
- <ic>freq(hz: number)</ic>: sets the frequency of the oscillator.
|
- <ic>freq(hz: number)</ic>: sets the frequency of the oscillator.
|
||||||
@ -40,7 +42,7 @@ ${makeExample(
|
|||||||
beat(.5) && snd('triangle').freq([100,200,400].beat(2)).out()
|
beat(.5) && snd('triangle').freq([100,200,400].beat(2)).out()
|
||||||
`,
|
`,
|
||||||
true,
|
true,
|
||||||
)}
|
)}
|
||||||
|
|
||||||
${makeExample(
|
${makeExample(
|
||||||
"Selecting a note",
|
"Selecting a note",
|
||||||
@ -60,7 +62,7 @@ ${makeExample(
|
|||||||
beat(1) && snd('triangle').chord(["C","Em7","Fmaj7","Emin"].beat(2)).adsr(0,.2).out()
|
beat(1) && snd('triangle').chord(["C","Em7","Fmaj7","Emin"].beat(2)).adsr(0,.2).out()
|
||||||
`,
|
`,
|
||||||
true,
|
true,
|
||||||
)}
|
)}
|
||||||
|
|
||||||
${makeExample(
|
${makeExample(
|
||||||
"Playing a chord from a list of notes and doing inversions",
|
"Playing a chord from a list of notes and doing inversions",
|
||||||
@ -68,7 +70,7 @@ ${makeExample(
|
|||||||
beat(.5) && snd('triangle').chord(60,64,67,72).invert([1,-3,4,-5].pick()).adsr(0,.2).out()
|
beat(.5) && snd('triangle').chord(60,64,67,72).invert([1,-3,4,-5].pick()).adsr(0,.2).out()
|
||||||
`,
|
`,
|
||||||
true,
|
true,
|
||||||
)}
|
)}
|
||||||
|
|
||||||
# Controlling amplitude
|
# Controlling amplitude
|
||||||
|
|
||||||
@ -80,13 +82,13 @@ ${makeExample(
|
|||||||
"Setting the gain",
|
"Setting the gain",
|
||||||
`beat(0.25) :: sound('sawtooth').gain([0.0, 1/8, 1/4, 1/2, 1].beat(0.5)).out()`,
|
`beat(0.25) :: sound('sawtooth').gain([0.0, 1/8, 1/4, 1/2, 1].beat(0.5)).out()`,
|
||||||
true,
|
true,
|
||||||
)}
|
)}
|
||||||
|
|
||||||
${makeExample(
|
${makeExample(
|
||||||
"Setting the velocity",
|
"Setting the velocity",
|
||||||
`beat(0.25) :: sound('sawtooth').velocity([0.0, 1/8, 1/4, 1/2, 1].beat(0.5)).out()`,
|
`beat(0.25) :: sound('sawtooth').velocity([0.0, 1/8, 1/4, 1/2, 1].beat(0.5)).out()`,
|
||||||
true,
|
true,
|
||||||
)}
|
)}
|
||||||
|
|
||||||
## Envelopes
|
## Envelopes
|
||||||
|
|
||||||
@ -109,7 +111,7 @@ beat(0.5) :: sound('wt_piano')
|
|||||||
.sustain([0.1,0.5].beat(4))
|
.sustain([0.1,0.5].beat(4))
|
||||||
.out()`,
|
.out()`,
|
||||||
true,
|
true,
|
||||||
)}
|
)}
|
||||||
|
|
||||||
This ADSR envelope design is important to know because it is used for other aspects of the synthesis engine such as the filters that we are now going to talk about. But wait, I've kept the best for the end. The <ic>adsr()</ic> combines all the parameters together. It is a shortcut for setting the ADSR envelope:
|
This ADSR envelope design is important to know because it is used for other aspects of the synthesis engine such as the filters that we are now going to talk about. But wait, I've kept the best for the end. The <ic>adsr()</ic> combines all the parameters together. It is a shortcut for setting the ADSR envelope:
|
||||||
|
|
||||||
@ -125,7 +127,7 @@ beat(0.5) :: sound('wt_piano')
|
|||||||
.out()
|
.out()
|
||||||
`,
|
`,
|
||||||
true,
|
true,
|
||||||
)}
|
)}
|
||||||
|
|
||||||
- <ic>ad(attack: number, decay: number)</ic>: sets the attack and decay phases, setting sustain and release to <ic>0</ic>.
|
- <ic>ad(attack: number, decay: number)</ic>: sets the attack and decay phases, setting sustain and release to <ic>0</ic>.
|
||||||
|
|
||||||
@ -139,7 +141,7 @@ beat(0.5) :: sound('wt_piano')
|
|||||||
.out()
|
.out()
|
||||||
`,
|
`,
|
||||||
true,
|
true,
|
||||||
)}
|
)}
|
||||||
|
|
||||||
## Substractive synthesis using filters
|
## Substractive synthesis using filters
|
||||||
|
|
||||||
@ -151,7 +153,7 @@ ${makeExample(
|
|||||||
"Filtering the high frequencies of an oscillator",
|
"Filtering the high frequencies of an oscillator",
|
||||||
`beat(.5) :: sound('sawtooth').cutoff(50 + usine(1/8) * 2000).out()`,
|
`beat(.5) :: sound('sawtooth').cutoff(50 + usine(1/8) * 2000).out()`,
|
||||||
true,
|
true,
|
||||||
)}
|
)}
|
||||||
|
|
||||||
${makeExample(
|
${makeExample(
|
||||||
"Simple synthesizer voice with filter",
|
"Simple synthesizer voice with filter",
|
||||||
@ -162,7 +164,7 @@ beat(.5) && snd('sawtooth')
|
|||||||
.out()
|
.out()
|
||||||
`,
|
`,
|
||||||
true,
|
true,
|
||||||
)}
|
)}
|
||||||
|
|
||||||
${makeExample(
|
${makeExample(
|
||||||
"Blessed by the square wave",
|
"Blessed by the square wave",
|
||||||
@ -173,7 +175,7 @@ beat([.5, .75, 2].beat()) :: [100,101].forEach((freq) => sound('square')
|
|||||||
.freq(freq*4 + usquare(2) * 200).sustain(0.125).out())
|
.freq(freq*4 + usquare(2) * 200).sustain(0.125).out())
|
||||||
beat(.25) :: sound('square').freq(100*[1,2,4,8].beat()).sustain(0.1).out()`,
|
beat(.25) :: sound('square').freq(100*[1,2,4,8].beat()).sustain(0.1).out()`,
|
||||||
false,
|
false,
|
||||||
)}
|
)}
|
||||||
|
|
||||||
${makeExample(
|
${makeExample(
|
||||||
"Ghost carillon (move your mouse!)",
|
"Ghost carillon (move your mouse!)",
|
||||||
@ -187,7 +189,7 @@ beat(1/8)::sound('sine')
|
|||||||
.gain(0.25)
|
.gain(0.25)
|
||||||
.out()`,
|
.out()`,
|
||||||
false,
|
false,
|
||||||
)}
|
)}
|
||||||
|
|
||||||
## Noise
|
## Noise
|
||||||
|
|
||||||
@ -204,7 +206,7 @@ beat(1) :: sound('triangle')
|
|||||||
.vibmod([1,2,4,8].beat(2))
|
.vibmod([1,2,4,8].beat(2))
|
||||||
.out()`,
|
.out()`,
|
||||||
true,
|
true,
|
||||||
)}
|
)}
|
||||||
|
|
||||||
## Wavetable synthesis
|
## Wavetable synthesis
|
||||||
|
|
||||||
@ -221,7 +223,7 @@ beat(1) :: sound('kick').n(4).out()
|
|||||||
beat(2) :: sound('snare').out()
|
beat(2) :: sound('snare').out()
|
||||||
beat(.5) :: sound('hh').out()`,
|
beat(.5) :: sound('hh').out()`,
|
||||||
true,
|
true,
|
||||||
)}
|
)}
|
||||||
|
|
||||||
|
|
||||||
Let's explore the galaxy of possible waveforms. It can be hard to explore them all, there is a **lot** of them:
|
Let's explore the galaxy of possible waveforms. It can be hard to explore them all, there is a **lot** of them:
|
||||||
@ -239,7 +241,7 @@ beat(2) :: v('swave', collection.pick())
|
|||||||
beat(0.5) :: sound(v('swave')).n(v('selec')).out()
|
beat(0.5) :: sound(v('swave')).n(v('selec')).out()
|
||||||
`,
|
`,
|
||||||
true,
|
true,
|
||||||
)}
|
)}
|
||||||
|
|
||||||
You can work with them just like with any other waveform. Having so many of them makes them also very useful for generating sound effects, percussive, sounds, etc...
|
You can work with them just like with any other waveform. Having so many of them makes them also very useful for generating sound effects, percussive, sounds, etc...
|
||||||
|
|
||||||
@ -265,7 +267,7 @@ beat(.25) && snd('triangle').adsr(0.02, 0.1, 0.1, 0.1)
|
|||||||
beat(2) :: sound('cp').room(1).sz(1).out()
|
beat(2) :: sound('cp').room(1).sz(1).out()
|
||||||
`,
|
`,
|
||||||
true,
|
true,
|
||||||
)}
|
)}
|
||||||
|
|
||||||
${makeExample(
|
${makeExample(
|
||||||
"Giving some love to ugly inharmonic sounds",
|
"Giving some love to ugly inharmonic sounds",
|
||||||
@ -276,7 +278,7 @@ beat(.5) :: sound('sine')
|
|||||||
.fmh([1, 1.75].beat())
|
.fmh([1, 1.75].beat())
|
||||||
.fmi($(1) % 30).orbit(2).room(0.5).out()`,
|
.fmi($(1) % 30).orbit(2).room(0.5).out()`,
|
||||||
true,
|
true,
|
||||||
)}
|
)}
|
||||||
|
|
||||||
${makeExample(
|
${makeExample(
|
||||||
"Peace and serenity through FM synthesis",
|
"Peace and serenity through FM synthesis",
|
||||||
@ -290,7 +292,7 @@ beat(0.25) :: sound('sine')
|
|||||||
.delayfb(0.8).fmh(Math.floor(usine(.5) * 4))
|
.delayfb(0.8).fmh(Math.floor(usine(.5) * 4))
|
||||||
.out()`,
|
.out()`,
|
||||||
true,
|
true,
|
||||||
)}
|
)}
|
||||||
|
|
||||||
**Note:** you can also set the _modulation index_ and the _harmonic ratio_ with the <ic>fm</ic> argument. You will have to feed both as a string: <ic>fm('2:4')</ic>. If you only feed one number, only the _modulation index_ will be updated.
|
**Note:** you can also set the _modulation index_ and the _harmonic ratio_ with the <ic>fm</ic> argument. You will have to feed both as a string: <ic>fm('2:4')</ic>. If you only feed one number, only the _modulation index_ will be updated.
|
||||||
|
|
||||||
@ -311,7 +313,7 @@ beat(.5) :: sound('sine')
|
|||||||
.fmsus(0).fmdec(0.2).out()
|
.fmsus(0).fmdec(0.2).out()
|
||||||
`,
|
`,
|
||||||
true,
|
true,
|
||||||
)}
|
)}
|
||||||
|
|
||||||
## ZzFX
|
## ZzFX
|
||||||
|
|
||||||
@ -325,7 +327,7 @@ ${makeExample(
|
|||||||
beat(.5) :: sound(['z_sine', 'z_triangle', 'z_sawtooth', 'z_tan', 'z_noise'].beat()).out()
|
beat(.5) :: sound(['z_sine', 'z_triangle', 'z_sawtooth', 'z_tan', 'z_noise'].beat()).out()
|
||||||
`,
|
`,
|
||||||
true,
|
true,
|
||||||
)}
|
)}
|
||||||
${makeExample(
|
${makeExample(
|
||||||
"Minimalist chiptune",
|
"Minimalist chiptune",
|
||||||
`
|
`
|
||||||
@ -339,7 +341,7 @@ beat(.5) :: sound('z_triangle')
|
|||||||
.pitchJumpTime(0.01).out()
|
.pitchJumpTime(0.01).out()
|
||||||
`,
|
`,
|
||||||
true,
|
true,
|
||||||
)}
|
)}
|
||||||
|
|
||||||
It comes with a set of parameters that can be used to tweak the sound. Don't underestimate this synth! It is very powerful for generating anything ranging from chaotic noise sources to lush pads:
|
It comes with a set of parameters that can be used to tweak the sound. Don't underestimate this synth! It is very powerful for generating anything ranging from chaotic noise sources to lush pads:
|
||||||
|
|
||||||
@ -377,7 +379,7 @@ beat(.25) :: sound('z_tan')
|
|||||||
.out()
|
.out()
|
||||||
`,
|
`,
|
||||||
true,
|
true,
|
||||||
)}
|
)}
|
||||||
${makeExample(
|
${makeExample(
|
||||||
"What is happening to me?",
|
"What is happening to me?",
|
||||||
`
|
`
|
||||||
@ -387,7 +389,7 @@ beat(1) :: snd('zzfx').zzfx([
|
|||||||
].beat()).out()
|
].beat()).out()
|
||||||
`,
|
`,
|
||||||
false,
|
false,
|
||||||
)}
|
)}
|
||||||
${makeExample(
|
${makeExample(
|
||||||
"Les voitures dans le futur",
|
"Les voitures dans le futur",
|
||||||
`
|
`
|
||||||
@ -399,7 +401,7 @@ beat(1) :: sound(['z_triangle', 'z_sine'].pick())
|
|||||||
.delayt(0.75).delayfb(0.5).out()
|
.delayt(0.75).delayfb(0.5).out()
|
||||||
`,
|
`,
|
||||||
false,
|
false,
|
||||||
)}
|
)}
|
||||||
|
|
||||||
Note that you can also design sounds [on this website](https://killedbyapixel.github.io/ZzFX/) and copy the generated code in Topos. To do so, please use the <ic>zzfx</ic> method with the generated array:
|
Note that you can also design sounds [on this website](https://killedbyapixel.github.io/ZzFX/) and copy the generated code in Topos. To do so, please use the <ic>zzfx</ic> method with the generated array:
|
||||||
${makeExample(
|
${makeExample(
|
||||||
@ -409,7 +411,7 @@ ${makeExample(
|
|||||||
beat(2) :: sound('zzfx').zzfx([3.62,,452,.16,.1,.21,,2.5,,,403,.05,.29,,,,.17,.34,.22,.68]).out()
|
beat(2) :: sound('zzfx').zzfx([3.62,,452,.16,.1,.21,,2.5,,,403,.05,.29,,,,.17,.34,.22,.68]).out()
|
||||||
`,
|
`,
|
||||||
true,
|
true,
|
||||||
)}
|
)}
|
||||||
|
|
||||||
# Speech synthesis
|
# Speech synthesis
|
||||||
|
|
||||||
@ -431,7 +433,7 @@ ${makeExample(
|
|||||||
once() && speak("Hello world!")
|
once() && speak("Hello world!")
|
||||||
`,
|
`,
|
||||||
true,
|
true,
|
||||||
)}
|
)}
|
||||||
|
|
||||||
${makeExample(
|
${makeExample(
|
||||||
"Let's hear people talking about Topos",
|
"Let's hear people talking about Topos",
|
||||||
@ -439,7 +441,7 @@ ${makeExample(
|
|||||||
beat(2) && speak("Topos!","fr",irand(0,5))
|
beat(2) && speak("Topos!","fr",irand(0,5))
|
||||||
`,
|
`,
|
||||||
true,
|
true,
|
||||||
)}
|
)}
|
||||||
|
|
||||||
|
|
||||||
You can also use speech by chaining methods to a string:
|
You can also use speech by chaining methods to a string:
|
||||||
@ -450,7 +452,7 @@ ${makeExample(
|
|||||||
onbeat(4) && "Foobaba".voice(irand(0,10)).speak()
|
onbeat(4) && "Foobaba".voice(irand(0,10)).speak()
|
||||||
`,
|
`,
|
||||||
true,
|
true,
|
||||||
)}
|
)}
|
||||||
|
|
||||||
${makeExample(
|
${makeExample(
|
||||||
"Building string and chaining",
|
"Building string and chaining",
|
||||||
@ -463,7 +465,7 @@ ${makeExample(
|
|||||||
beat(6) && sentence.pitch(0).rate(0).voice([0,2].pick()).speak()
|
beat(6) && sentence.pitch(0).rate(0).voice([0,2].pick()).speak()
|
||||||
`,
|
`,
|
||||||
true,
|
true,
|
||||||
)}
|
)}
|
||||||
|
|
||||||
${makeExample(
|
${makeExample(
|
||||||
"Live coded poetry with array and string chaining",
|
"Live coded poetry with array and string chaining",
|
||||||
@ -483,6 +485,6 @@ ${makeExample(
|
|||||||
.speak();
|
.speak();
|
||||||
`,
|
`,
|
||||||
true,
|
true,
|
||||||
)}
|
)}
|
||||||
`;
|
`;
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user