Skip to content

Commit

Permalink
bug fixes and source id to nil
Browse files Browse the repository at this point in the history
  • Loading branch information
narcode committed Oct 23, 2017
1 parent 2e3bfbf commit 3c6c7f0
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
2 changes: 0 additions & 2 deletions hello world/SC/CodeKlavier_hello_world_v_sampler.scd
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
// midi mappings:
s.waitForBoot({
"starting MIDI...".postln;
MIDIIn.connectAll;
s.sync;
MIDIClient.init;
s.sync;
MIDIIn.connectAll;
Expand Down
13 changes: 11 additions & 2 deletions hello world/SC/codespace.scd
Original file line number Diff line number Diff line change
@@ -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;


//
2 changes: 1 addition & 1 deletion hello world/SC/toypiano_sampler.scd
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 3c6c7f0

Please sign in to comment.