Cursed Conlang Circus 3 submission
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

39 lines
1.2 KiB

4 months ago
  1. s.quit;
  2. s.boot;
  3. (
  4. var pulse, playString, theString;
  5. SynthDef.new(\DTMF, { arg f1, f2, out; Out.ar(out, [SinOsc.ar(f1) + SinOsc.ar(f2), SinOsc.ar(f1) + SinOsc.ar(f2)])}).add;
  6. TempoClock.default.tempo = 100;
  7. pulse = { arg f1, f2;
  8. f = Synth.new(\DTMF, [\f1, f1, \f2, f2]);
  9. TempoClock.sched(12, { f.free; });
  10. };
  11. playString = {|data|
  12. r = Routine({
  13. data.do({ arg item, i;
  14. switch(item)
  15. {$0} {pulse.value(941, 1336)}
  16. {$1} {pulse.value(697, 1209)}
  17. {$2} {pulse.value(697, 1336)}
  18. {$3} {pulse.value(697, 1477)}
  19. {$4} {pulse.value(770, 1209)}
  20. {$5} {pulse.value(770, 1336)}
  21. {$6} {pulse.value(770, 1477)}
  22. {$7} {pulse.value(852, 1209)}
  23. {$8} {pulse.value(852, 1336)}
  24. {$9} {pulse.value(852, 1477)}
  25. {$A} {pulse.value(697, 1633)}
  26. {$B} {pulse.value(770, 1633)}
  27. {$C} {pulse.value(852, 1633)}
  28. {$D} {pulse.value(941, 1633)}
  29. {$*} {pulse.value(941, 1209)}
  30. {$#} {pulse.value(941, 1477)};
  31. 15.yield;
  32. })
  33. });
  34. TempoClock.default.sched(0, r);
  35. };
  36. theString = File.readAllString("/home/annwan/code/projects/ccc3/tools/sounder/text.txt");
  37. playString.value(theString);
  38. s.record(path: "/home/annwan/code/projects/ccc3/tools/sounder/text2.wav", numChannels: 1);
  39. TempoClock.default.sched(theString.size * 15, {s.stopRecording;});
  40. )