; C I R C L E M A P D E M O N S T R A T I O N ; Copyright 2012 by Michael Gogins. ; This software is licesed under the terms of the Library GNU Public License verson 3. ; ; With patience, quite an amazing zoo of sounds can be coaxed from this instrument. ; There are fiddly places where the spinners not the sliders must be used. ; There are gaps in the coupling parameter space where nothing happens. Be patient! ; ; This is tricky to get to work because it must run at ksmps=1, but the user interface will ; then tend to interrupt the audio stream. Try rendering in a separate thread and ; with a large hardware buffer size. ; ; Also, note that that font is Courier New 8 point with "tab size" 28. sr = 44100 ksmps = 1 nchnls = 2 0dbfs = 10 chn_k "kin_coupling", 1 chn_k "kin_filter_frequency", 1 chn_k "kin_filter_q", 1 chn_k "kin_frequency", 1 chn_k "kin_master_level", 1 chn_k "kin_reverb_feedback", 1 chn_k "kin_reverb_wet", 1 chn_k "kout_amplitude", 2 chn_k "kout_frequency", 2 chn_k "kphase_increment", 2 alwayson "CircleMap" ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; Circle map (See Essl, daFX 2006) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; instr CircleMap isine ftgenonce 0, 0, 65536, 10, 1 itwopi init 6.283185307179586476925286766559 print itwopi aphase0 init 0 kin_frequency chnget "kin_frequency" kin_coupling chnget "kin_coupling" kphase_increment = kin_frequency / sr aphase = (aphase0 + kphase_increment - (kin_coupling / itwopi) * sin(itwopi * aphase0)) % 1.0 aphase0 = aphase asignal table aphase, isine, 1 ; Resonant filter. kin_filter_frequency chnget "kin_filter_frequency" kin_filter_q chnget "kin_filter_q" asignal moogladder asignal, kin_filter_frequency, kin_filter_q, 1.00 ; Reverberation. kin_reverb_feedback chnget "kin_reverb_feedback" aleftsignal, arightsignal reverbsc asignal, asignal, kin_reverb_feedback, 14000 kin_reverb_wet chnget "kin_reverb_wet" kreverb_dry = (1.0 - kin_reverb_wet) aleftwet = kin_reverb_wet * aleftsignal arightwet = kin_reverb_wet * arightsignal aleftdry = kreverb_dry * asignal arightdry = kreverb_dry * asignal ; Anti-clicking. anticlick linsegr 0.0, 0.1, 1.0, 1000, 1.0, 0.1, 0.0 kin_master_level chnget "kin_master_level" aoutleft = (aleftwet + aleftdry) * anticlick * kin_master_level aoutright = (arightwet + arightdry) * anticlick * kin_master_level kright downsamp aoutleft kleft downsamp aoutright ; Display actual frequency and amplitude. kout_frequency, kout_amplitude ptrack aoutleft, 1024 outs aoutleft, aoutright dispfft aoutleft, 0.25, 1024 chnset kout_frequency, "kout_frequency" chnset kout_amplitude, "kout_amplitude" chnset kphase_increment, "kphase_increment" endin f 0 36000 708 53 443 415 true 148 176 227 9 10 202 47 {1f0eaf99-e8f9-4a75-9c84-1ad4490cfe43} true 0 0 left top Arial 10 3 0 0 0 157 226 227 noborder 1 0 kin_frequency 16 34 189 18 {65b458c4-2f99-476c-9588-484a0a90b679} true 0 0 0.00000000 20000.00000000 16084.65608466 lin continuous -1.00000000 false 9 55 202 47 {9d56cb37-d337-4901-98c1-a42b14fb02a7} true 0 0 left top Arial 10 3 0 0 0 157 226 227 noborder 1 0 kin_coupling 16 79 189 18 {6b1aaaf1-d192-4471-b43c-205e1c8e3585} true 0 0 0.00000000 10.00000000 0.95560000 lin continuous -1.00000000 false 9 113 202 47 {a41d5615-20e3-4091-b2fb-9a9ac9ce37fe} true 0 0 left top Arial 10 3 0 0 0 224 227 155 noborder 1 0 kin_filter_frequency 16 137 189 18 {6464132d-f55d-4221-a246-ca2cd929a9d0} true 0 0 0.00000000 15000.00000000 6904.76190476 lin continuous -1.00000000 false 9 158 202 47 {549b856e-c525-4249-85d6-bcdbbbcf01b7} true 0 0 left top Arial 10 3 0 0 0 224 227 155 noborder 1 0 kin_filter_q 16 182 189 18 {a6bd0a70-834e-473a-adf4-594a9d0759ea} true 0 0 0.00000000 1.25000000 0.84656085 lin continuous -1.00000000 false 9 215 202 47 {c4d148b9-60a4-4fec-bcf6-1612052148f3} true 0 0 left top Arial 10 3 0 0 0 222 189 255 noborder 1 0 kin_reverb_feedback 16 239 189 18 {dc038ef0-758d-491e-b79f-f84201456979} true 0 0 0.00000000 1.00000000 0.81481481 lin continuous -1.00000000 false 9 261 202 47 {1c2d42b7-973d-43cf-9f6b-30c1d0267f65} true 0 0 left top Arial 10 3 0 0 0 222 189 255 noborder 1 0 kin_reverb_wet 16 285 189 18 {bdbb825d-772c-4946-b7ed-57ea0fbcc5f5} true 0 0 0.00000000 1.00000000 0.78306878 lin continuous -1.00000000 false 9 318 202 56 {9a783fce-6cd6-402d-be8a-da4ab2228075} true 0 0 left top Arial 10 3 0 0 0 135 235 168 noborder 1 0 kin_master_level 16 342 189 18 {01bccb3b-c15f-4faa-ae38-71e434837ff4} true 0 0 0.00000000 10.00000000 1.85185185 lin continuous -1.00000000 false kin_coupling 135 57 70 20 {9b5a0792-28f8-45eb-b0c9-a34cdc04be51} true 0 0 right Arial 10 0 0 0 255 255 255 0.00010000 -1e+12 1e+12 false 0.9556 kin_frequency 135 12 70 20 {ecea3aa0-7230-4685-a33f-2adea81f8728} true 0 0 right Liberation Sans 10 0 0 0 255 255 255 0.00010000 -1e+12 1e+12 false 16084.7 kin_filter_frequency 135 116 70 20 {f8173d43-38ee-4145-9e81-a11483549005} true 0 0 right Arial 10 0 0 0 255 255 255 0.00010000 -1e+12 1e+12 false 6904.76 kin_master_level 135 321 70 20 {4a5feede-3b6f-4e02-9bc0-becdf68151eb} true 0 0 right Arial 10 0 0 0 255 255 255 0.00010000 -1e+12 1e+12 false 1.85185 kin_filter_q 135 161 70 20 {134531d5-d05b-4b9f-b846-14559c16b4e6} true 0 0 right Arial 10 0 0 0 255 255 255 0.00010000 -1e+12 1e+12 false 0.846561 kin_reverb_wet 135 263 70 20 {95e33206-8d0f-4106-afcb-5dc824042e83} true 0 0 right Arial 10 0 0 0 255 255 255 0.00010000 -1e+12 1e+12 false 0.783069 kin_reverb_feedback 135 217 70 20 {61927369-ebb2-4f48-9d9b-40653cf0c0d5} true 0 0 right Arial 10 0 0 0 255 255 255 0.00010000 -1e+12 1e+12 false 0.814815 210 10 200 92 {993f7eda-9518-4f5c-9951-c75d261519de} true 0 0 left top Arial 10 3 0 0 0 195 235 195 noborder 1 0 kphase_increment 309 13 96 22 {cb7289db-d623-4e2b-8299-d02fd9cb2d0d} true 0 0 right Arial 10 3 0 0 0 239 239 239 nobackground 210 318 203 29 {669f10e4-ae61-40b2-a7eb-52501f6202b2} true 0 0 left top Arial 10 3 0 0 0 195 235 195 noborder 1 0 kout_frequency 309 321 100 20 {0494fdd9-320c-456d-a877-afb100b2e04a} true 0 0 right Arial 10 3 0 0 0 239 239 239 nobackground 210 345 203 29 {f959e4fb-d970-4a53-9c8a-cffaab22d58f} true 0 0 left top Arial 10 3 0 0 0 195 235 195 noborder 1 0 kout_amplitude 309 348 100 20 {b92022d7-b6e9-4793-9ea3-4177d55f1c8a} true 0 0 right Arial 10 3 0 0 0 239 239 239 nobackground 218 113 192 195 {401acbc9-235e-47f5-93a4-3a6e13d1f4f5} true 0 0 -255.00000000 lissajou 2.00000000 1.00000000 1.00000000 1.00000000 0.00000000