Created
November 30, 2020 02:41
-
-
Save cleary/faf0dc7cedb763398861aaa3699995d2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- https://www.youtube.com/toplap_barcelona/live | |
-- extra functions added to tidal_function_helpers.tidal | |
-- see also: https://club.tidalcycles.org/t/superfm/1761/8 | |
-- for extra syntax options | |
-- adsr, see screenshot in dir | |
-- There are 6 operators/oscillators, | |
-- all are carriers (algorithm 32 in DX7 no fb loop) | |
-- operators are sinusoidal waves, and can be used in two ways: | |
-- 1. Sound generation: Carrier | |
-- 2. Modulate other operators: Modulators | |
d1 | |
$ s "superfm" | |
# gain 0.7 | |
# n 0 | |
-- mute all operators except 1 | |
-- 0-1 affects amplitude | |
d1 | |
$ s "superfm" | |
# n 0 | |
# amp1 0.1 | |
# amp2 0 | |
# amp3 0 | |
# amp4 0 | |
# amp5 0 | |
# amp6 0 | |
-- we can apply a ratio to base frequency (multiplier) | |
d1 | |
$ s "superfm" | |
# n 0 | |
# amp1 0.1 | |
# amp2 0 | |
# amp3 0 | |
# amp4 0 | |
# amp5 0 | |
# amp6 0 | |
# ratio1 2 -- 2 == octave higher | |
-- two ratios on two carriers | |
d1 | |
$ s "superfm" | |
# n 0 | |
# amp1 1 | |
# amp2 1 | |
# amp3 0 | |
# amp4 0 | |
# amp5 0 | |
# amp6 0 | |
# ratio1 1 | |
# ratio2 2 -- octave higher | |
-- set two carrier ratios close together, get a beating effect | |
d1 | |
$ s "superfm" | |
# n 0 | |
# amp1 1 | |
# amp2 1 | |
# amp3 0 | |
# amp4 0 | |
# amp5 0 | |
# amp6 0 | |
# ratio1 1 | |
# ratio2 1.01 | |
-- basic hammond, change octaves is like pulling bars in a hammond | |
-- this is basic FM synthesis without modulation, | |
-- same as an analog synth with 6 oscillators | |
d1 | |
$ s "superfm" | |
# n 0 | |
# amp1 1 | |
# amp2 1 | |
# amp3 0.5 | |
# amp4 0.4 | |
# amp5 0.3 | |
# amp6 0.2 | |
# ratio1 1 | |
# ratio2 2 | |
# ratio2 3 | |
# ratio2 2 | |
# ratio2 5 | |
# ratio2 6 | |
-- moving onto modulation - # mod[carrier][operator_to_apply_to_carrier] | |
d1 | |
$ s "superfm" | |
# n 0 | |
# amp1 1 | |
# amp2 0 | |
# amp3 0 | |
# amp4 0 | |
# amp5 0 | |
# amp6 0 | |
# mod12 4 -- modulate carrier 1 with operator 2, increase integer to sharpen | |
-- ie operator 2 is applied to the sound of operator 1 | |
-- apply ratio to operator 2, v. small can make vibrato | |
-- increase up to 1 (no effect) | |
d1 | |
$ s "superfm" | |
# n 0 | |
# amp1 1 | |
# amp2 0 | |
# amp3 0 | |
# amp4 0 | |
# amp5 0 | |
# amp6 0 | |
# mod12 5 | |
# ratio2 0.01 -- very slow vibrato at 0.01 | |
-- the ratio of the carrier and the modulator | |
-- if they are the same freq, we get a sawtooth wave (more or less) | |
d1 | |
$ s "superfm" | |
# n 0 | |
# amp1 1 | |
# amp2 0 | |
# amp3 0 | |
# amp4 0 | |
# amp5 0 | |
# amp6 0 | |
# mod12 5 | |
# ratio1 1 | |
# ratio2 1 -- double (2) to get a pulse wave | |
-- keep as integer to get harmonics | |
-- use floats to get enharmonics(?) metallic sounds | |
-- prophet sound, using 2x carriers 2x modulators | |
-- double sawtooth | |
d1 | |
$ s "superfm" | |
# n 0 | |
# amp1 1 | |
# amp2 0 | |
# amp3 1 | |
# amp4 0 | |
# amp5 0 | |
# amp6 0 | |
# mod12 1 | |
# mod34 1 | |
# ratio1 1 | |
# ratio2 2 | |
# ratio3 1 | |
# ratio4 2 | |
-- small changes result in drastic sound changes | |
-- and can be patterned | |
d1 | |
$ s "superfm" | |
# n 0 | |
# gain 0.8 | |
# amp1 1 | |
# amp2 0 | |
# amp3 1 | |
# amp4 0 | |
# amp5 0 | |
# amp6 0 | |
# mod12 1 | |
# mod34 1 | |
# ratio1 1 | |
# ratio2 2 | |
# ratio3 "<1.1 1 0.9 1.05>" | |
# ratio4 2 | |
-- two modulators can affect a carrier [1]-[2]-[3] | |
d1 | |
$ s "superfm" | |
# n 0 | |
# gain 0.8 | |
# amp1 1 | |
# amp2 0 | |
# amp3 0 | |
# amp4 0 | |
# amp5 0 | |
# amp6 0 | |
# mod12 1 -- 2. if both muted (0), then we have the sine wave of the orig carrier | |
# mod23 1 -- 1. if muted (0), will have same sawtooth wave as at beginning | |
-- two modulators can affect two carriers [1]-[2], [3]-[4] | |
d1 | |
$ s "superfm" | |
# n 0 | |
# gain 0.8 | |
# amp1 1 | |
# amp2 0 | |
# amp3 1 | |
# amp4 0 | |
# amp5 0 | |
# amp6 0 | |
# mod12 1 | |
# mod34 1 | |
-- two modulators can affect 1 carrier in parallel [1]-[2] | |
-- \[3] | |
d1 | |
$ s "superfm" | |
# n 0 | |
# gain 0.8 | |
# amp1 1 | |
# amp2 0 | |
# amp3 0 | |
# amp4 0 | |
# amp5 0 | |
# amp6 0 | |
# mod12 1 -- \ | |
# mod13 1 -- - saw + pulse wave "salse?" | |
# ratio2 2 -- apply ratio to 2 modulator | |
-- modulator can modulate itself (feedback) note feedback option must be on | |
-- feedback is a float 0-1 | |
d1 | |
$ s "superfm" | |
# n 0 | |
# gain 0.8 | |
# amp1 1 | |
# amp2 0 | |
# amp3 0 | |
# amp4 0 | |
# amp5 0 | |
# amp6 0 | |
# mod11 1 | |
# feedback 1 -- this global default needs to be set on | |
-- a modulator can feedback on itself | |
d1 | |
$ s "superfm" | |
# n 0 | |
# gain 0.8 | |
# amp1 1 | |
# amp2 0 | |
# amp3 0 | |
# amp4 0 | |
# amp5 0 | |
# amp6 0 | |
# mod12 1 -- 2 is modulating carrier 1 | |
# mod22 1 -- 2 is also modulating itself | |
# feedback 1 | |
-- if you crank the feeding back modulator, you get noise | |
-- can still hear sine wave of carrier | |
d1 | |
$ s "superfm" | |
# n 0 | |
# gain 0.8 | |
# amp1 1 | |
# amp2 0 | |
# amp3 0 | |
# amp4 0 | |
# amp5 0 | |
# amp6 0 | |
# mod12 1 | |
# mod22 6 -- noise | |
# feedback 1 | |
-- to remove the carrier sine wave, take out the 1 carrier | |
-- turn on the 2 modulator as a carrier | |
d1 | |
$ s "superfm" | |
# n 0 | |
# gain 0.8 | |
# amp1 0 | |
# amp2 1 | |
# amp3 0 | |
# amp4 0 | |
# amp5 0 | |
# amp6 0 | |
-- # mod12 1 | |
# mod22 6 -- noise | |
# feedback 1 | |
# ratio2 0 | |
-- a feedback loop can also be created wih two modulators feeding into each other | |
d1 | |
$ s "superfm" | |
# n 0 | |
# gain 0.8 | |
# amp1 0 | |
# amp2 1 | |
# amp3 0 | |
# amp4 0 | |
# amp5 0 | |
# amp6 0 | |
# mod12 1 | |
# mod21 1 | |
# feedback 1 | |
-- ENVELOPES -- | |
-- | |
-- defined as a 4 stage envelope as opposed to ADSR | |
-- diagram: https://youtu.be/REgE33Esy2Q?t=2372 | |
-- egrate1 == attack (amplitude val) | |
-- egrate2 == decay (amplitude val) | |
-- eglevel2+eglevel3 == sustain | |
-- egrate4 == release (amplitude val) | |
-- allows creation of your own waveshapes | |
-- equivalent to sustain in ADSR, eglevel2 = eglevel3 | |
d1 | |
$ s "superfm" | |
# n 0 | |
# gain 0.8 | |
# amp1 1 | |
# amp2 0 | |
# amp3 0 | |
# amp4 0 | |
# amp5 0 | |
# amp6 0 | |
# egrate11 10 -- fast attack | |
# eglevel12 0.1 -- \ | |
# eglevel13 0.1 -- - equivalent to sustain at 0.1 in ADSR | |
-- crescendo | |
d1 | |
$ slow 4 | |
$ s "superfm" | |
# n 0 | |
# gain 0.8 | |
# amp1 1 | |
# amp2 0 | |
# amp3 0 | |
# amp4 0 | |
# amp5 0 | |
# amp6 0 | |
# egrate11 0.1 -- slow attack | |
# eglevel12 1 -- eglevel 2 low | |
# eglevel13 10 -- eglevel 3 much higher | |
-- low octave sound | |
d1 | |
$ slow 4 | |
$ s "superfm" | |
# n 0 | |
# octave 3 | |
# gain 0.8 | |
# amp1 1 | |
# amp2 0 | |
# amp3 0 | |
# amp4 0 | |
# amp5 0 | |
# amp6 0 | |
# mod12 1 -- modulate carrier with envelope affected operator | |
# egrate21 0.5 -- put the envelope on operator 2 | |
# eglevel22 0.1 | |
# eglevel23 1 | |
-- low octave sound start | |
d1 | |
$ slow 4 | |
$ s "superfm" | |
# n 0 | |
# octave 4 | |
# gain 0.8 | |
# amp1 1 | |
# amp2 0 | |
# amp3 0 | |
# amp4 0 | |
# amp5 0 | |
# amp6 0 | |
# mod12 1 -- modulate carrier with envelope affected operator | |
# ratio2 0.25 -- | |
# egrate21 10 -- put the envelope on operator 2 | |
# eglevel22 0.1 | |
# egrate23 0.5 | |
# eglevel23 1.5 | |
# room 1 | |
-- # feedback 1 -- with feedback it's clearer | |
-- # mod11 1 | |
-- can start patterning for cool rhythm | |
d1 | |
$ s "superfm*4" | |
# n 0 | |
# octave 5 | |
# gain 0.8 | |
# amp1 1 | |
# amp2 0 | |
# amp3 0 | |
# amp4 0 | |
# amp5 0 | |
# amp6 0 | |
# mod12 "0 1 2" -- modulate carrier with envelope affected operator | |
# ratio2 0.25 | |
# egrate21 10 -- put the envelope on operator 2 | |
# eglevel22 "0.1 0.5 1" | |
# egrate23 "1 10 0.1" | |
# eglevel23 1.5 | |
# room 1 | |
# feedback 1 | |
# mod11 1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment