From f34df445a29f88fdf5e59c836bf270c2fe1cef8f Mon Sep 17 00:00:00 2001 From: Pete Shadbolt Date: Mon, 3 May 2021 13:40:12 -0700 Subject: [PATCH] Can create a synthdef and play it --- sine.scd => audio.scd | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) rename sine.scd => audio.scd (53%) diff --git a/sine.scd b/audio.scd similarity index 53% rename from sine.scd rename to audio.scd index 1d6d4c2..27fa212 100644 --- a/sine.scd +++ b/audio.scd @@ -1,16 +1,13 @@ s = Server.local; s.waitForBoot { - // Set up OSC communications + var module; thisProcess.openUDPPort(5005); n = NetAddr.new("0.0.0.0", 5005); o = OSCFunc({ arg msg, time, addr, recvPort; [msg, time, addr, recvPort].postln; }, '/radio', n); OSCFunc.trace(true); + module = SynthDef.new("module", { + Out.ar(0, SinOsc.ar(440)); + }); - // Start some oscillators - { - var x = SinOsc.ar(MouseX.kr(1, 100)); - SinOsc.ar(300 * x + 800, 0, 0.1) - + - PinkNoise.ar(0.1 * x + 0.1) - }.play; + module.play; };