Last active
September 4, 2024 02:12
-
-
Save yotamorimoto/3dddf045b983988d7fce75a9fd4a830c to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| Server.supernova; | |
| s.reboot; | |
| // use your own sound instead: | |
| b = Buffer.read(s,"/Users/yota/Desktop/tail.wav"); | |
| b = Buffer.read(s,"/Users/yota/Music/am_cpb/maison/mk_nuit1-.wav"); | |
| ~pos = Bus.control; | |
| ( | |
| SynthDef(\play, { |rate=1, pos=0, dur=1, pan=0| | |
| var sig, env; | |
| sig = PlayBuf.ar(2, b, rate, 1, ~pos.kr*SampleRate.ir); | |
| env = Env([0,1,1,0],[0.01,0.5,0.49]*dur).kr(2); | |
| sig = Pan2.ar(sig, pan, env); | |
| Out.ar(0, sig); | |
| SendTrig.kr(DC.kr(1),0, ~pos.kr); | |
| }).add; | |
| ) | |
| ( | |
| var dur = b.duration; | |
| var speed = b.duration.reciprocal; | |
| ~focus = { |f=0| Out.kr(~pos, SelectXFocus.kr(f, [ | |
| SinOsc.kr(speed*100).range(0,dur), | |
| BrownNoise.kr.range(0,dur), | |
| PinkNoise.kr.range(0,dur), | |
| ClipNoise.kr.range(0.1,dur*0.9) | |
| ], 1, true | |
| ) | |
| )}.play; | |
| g = ParGroup.new; | |
| r{ | |
| o = OSCFunc({ |m| c=(m[3]/dur*16);{w.refresh}.defer; }, '/tr', s.addr); | |
| loop{ | |
| Synth(\play, [rate: 0.9, dur:0.1, pan: -1.rrand(1.0)], g); | |
| 0.01.wait; | |
| } | |
| }.play; | |
| ) | |
| ( | |
| c = 0; | |
| w = Window("", Rect(296.0, 490.0, 742.0, 68.0)); | |
| z = 180 / 4; | |
| u = UserView.new; | |
| u.drawFunc = { | |
| 16.do { |i| | |
| (c.asInteger==i).if({ | |
| Pen.fillColor = Color.rand; | |
| }, { | |
| Pen.fillColor = Color.grey(1, 0.5); | |
| }); | |
| Pen.fillRect(Rect(i*z, 0, z-1, z-1)); | |
| }; | |
| }; | |
| w.layout = VLayout(u); | |
| w.front; | |
| k = Window("",Rect(671.0, 253.0, 196.0, 190.0)); | |
| k.layout = HLayout( | |
| Knob().action_({ |v| ~focus.set(\f, v.value.linlin(0,1,0,4)) }), | |
| ); | |
| k.front; | |
| k.bounds; | |
| CmdPeriod.doOnce { w.close; k.close }; | |
| ) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment