From: Eugene Petkevich Date: Fri, 6 May 2022 14:30:29 +0000 (+0300) Subject: Add test file X-Git-Url: https://git.zuelum.org/?a=commitdiff_plain;h=b10eb07911dc818b4831551a6c8a047c16a53bce;p=scprojects.git Add test file --- diff --git a/test.scd b/test.scd new file mode 100644 index 0000000..5eb4add --- /dev/null +++ b/test.scd @@ -0,0 +1,62 @@ +~se = ~samplerFactory.value; + +~se.startRec(); +~se.stopRec(); + +~se.buf.plot; +~se.buf.getToFloatArray(wait:0.01, action: {arg array; a = array; { a[0..100].plot }.defer; "done".postln }); + +~se.playSample(); +~se.duration = 2.5; + +( +SynthDef(\test, { |amp = 1.0| + Out.ar(0, SoundIn.ar(1!2, amp.lag(0.01))); +}).add; +) + +a = Synth(\test); +a.free; + +( +MIDIdef.cc(\pollcc, { |...args| + //"cc".postln; + //args.postln; +}); + +MIDIdef.noteOn(\pollnoteon, { |...args| + "noteon".postln; + args.postln; +}); +) + +( +MIDIdef.cc(\tafe, { |...args| + var amp = args[0].linlin(0, 127, 0.1, 20); + a.set(\amp, amp); + amp.postln; +}, 1); +) + +/// push test + +~push = ~pushFactory.value; + +( +~color = 0; +8.do({|i| + 4.do({|j| + ~push.hcPushPadLed(j+4, i, 3, ~color, true, 0); + ~color = ~color + 1; + }); +}); +) + +~push.hcPushKeyPressure.valueArray([1, 2, 3, 4]); +~push.hcPushKeyOn.valueArray([1, 2, 3, 4]); + +( +~push.hcPushKeyOn = {|...args| + args[1].postln; +}; +) \ No newline at end of file