|
|
s.quit; s.boot; ( var pulse, playString, theString; SynthDef.new(\DTMF, { arg f1, f2, out; Out.ar(out, [SinOsc.ar(f1) + SinOsc.ar(f2), SinOsc.ar(f1) + SinOsc.ar(f2)])}).add; TempoClock.default.tempo = 100; pulse = { arg f1, f2; f = Synth.new(\DTMF, [\f1, f1, \f2, f2]); TempoClock.sched(8, { f.free; }); }; playString = {|data| r = Routine({ data.do({ arg item, i; switch(item) {$0} {pulse.value(941, 1336)} {$1} {pulse.value(697, 1209)} {$2} {pulse.value(697, 1336)} {$3} {pulse.value(697, 1477)} {$4} {pulse.value(770, 1209)} {$5} {pulse.value(770, 1336)} {$6} {pulse.value(770, 1477)} {$7} {pulse.value(852, 1209)} {$8} {pulse.value(852, 1336)} {$9} {pulse.value(852, 1477)} {$A} {pulse.value(697, 1633)} {$B} {pulse.value(770, 1633)} {$C} {pulse.value(852, 1633)} {$D} {pulse.value(941, 1633)} {$*} {pulse.value(941, 1209)} {$#} {pulse.value(941, 1477)}; 10.yield; }) }); TempoClock.default.sched(0, r); }; theString = File.readAllString("/home/annwan/code/projects/ccc3/tools/sounder/text.txt"); theString.postln; playString.value(theString); s.record(path: "/home/annwan/code/projects/ccc3/tools/sounder/text.wav", numChannels: 1); TempoClock.default.sched(theString.size * 10, { s.stopRecording; theString = File.readAllString("/home/annwan/code/projects/ccc3/tools/sounder/name.txt"); theString.postln; playString.value(theString); s.record(path: "/home/annwan/code/projects/ccc3/tools/sounder/name.wav", numChannels: 1); TempoClock.default.sched(theString.size * 10, {s.stopRecording;}); }); )
|