From fefc5b7eed752413cab5e1426b7df9387d2f9f42 Mon Sep 17 00:00:00 2001 From: Mike Lynch Date: Mon, 10 Apr 2023 17:13:04 +1000 Subject: [PATCH] Setting default parameters in the init --- classes/Granulator.sc | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/classes/Granulator.sc b/classes/Granulator.sc index e7005bd..d799ab7 100644 --- a/classes/Granulator.sc +++ b/classes/Granulator.sc @@ -7,7 +7,7 @@ Granulator { SynthDef( \grain_record, { - arg in = 2, buffer = 0, mix = 0.25, record = 0.0; + arg in = 2, buffer = 0, mix = 0.5, record = 0.0; var insig = record * In.ar(in, 1); RecordBuf.ar(insig, buffer, 0, mix, 1 - mix, loop: 1) } @@ -55,6 +55,8 @@ Granulator { ^super.new.init(buflen, inb, outb, posb); } + // note that the default values here have been hand-picked to match the TouchOSC + // defaults, which is Bad. init { | abuflen, ainb, aoutb, aposb | buflen = abuflen; @@ -63,6 +65,19 @@ Granulator { posb = aposb; server = Server.default; mode = 0; + blur = 0; + size = 0.1; + trigger = 120; + dust = 0; + back = 0; + slope = 1; + chorus = 0; + detune = 0; + pitch = 0; + mix = 0.25; + pan = 0; + track = 0.5; + jitter = 0.25; triggerb = Bus.control(server, 1); pitchb = Bus.control(server, 1); buffer = Buffer.alloc(server, server.sampleRate * buflen, 1);