diff --git a/hello world/SC/CodeKlavier_hello_world_v_sampler.scd b/hello world/SC/CodeKlavier_hello_world_v_sampler.scd index e191516..494269d 100644 --- a/hello world/SC/CodeKlavier_hello_world_v_sampler.scd +++ b/hello world/SC/CodeKlavier_hello_world_v_sampler.scd @@ -1,8 +1,6 @@ // midi mappings: s.waitForBoot({ "starting MIDI...".postln; -MIDIIn.connectAll; -s.sync; MIDIClient.init; s.sync; MIDIIn.connectAll; diff --git a/hello world/SC/codespace.scd b/hello world/SC/codespace.scd index 5c5f031..f476cc7 100644 --- a/hello world/SC/codespace.scd +++ b/hello world/SC/codespace.scd @@ -1,6 +1,15 @@ // code space ~path = thisProcess.nowExecutingPath.dirname -(~path ++ "/CodeKlavier_hello_world_v4.scd").load; -//{2.do{(~path ++ "/toypiano_sampler.scd").load; 2.wait;};}.fork; + + +// evaluate one from below, not both \\\ + +// OPTION 1: to load internal toy pinao sampler (i.e. midi loopback): +(~path ++ "/CodeKlavier_hello_world_v_sampler.scd").load; +{2.do{(~path ++ "/toypiano_sampler.scd").load; 2.wait;};}.fork; + +// OPTION 2: to play with Robot Toy Piano instrument (i.e. midiout): +(~path ++ "/CodeKlavier_hello_world_v_sampler.scd").load; + // diff --git a/hello world/SC/toypiano_sampler.scd b/hello world/SC/toypiano_sampler.scd index 54dd7c9..9573f59 100644 --- a/hello world/SC/toypiano_sampler.scd +++ b/hello world/SC/toypiano_sampler.scd @@ -23,7 +23,7 @@ s.sync; // sampler node: MIDIdef.noteOn(\toypiano, {arg ...args; var midinote = args[1]-56; - //args.postln; + // args.postln; midinote.postln; if (midinote < 64 && midinote >= 0) { Ndef(midinote.asSymbol, {PlayBuf.ar(2, b[midinote], loop:0) * EnvGen.kr(Env.perc(0.01, 1.5))}).play(6, group: g);