aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Runge <dave@sleepmap.de>2020-12-30 01:11:57 +0100
committerDavid Runge <dave@sleepmap.de>2020-12-30 01:11:57 +0100
commit8d943f2513085f540e3bcf8ac345ea8a391730cc (patch)
treecfa3d58535e668002915261f0adc544035b7ac21
parent8fc44117e9130d5f078a373f57ff0314fbc4596e (diff)
downloadzzz-8d943f2513085f540e3bcf8ac345ea8a391730cc.tar.gz
zzz-8d943f2513085f540e3bcf8ac345ea8a391730cc.tar.bz2
zzz-8d943f2513085f540e3bcf8ac345ea8a391730cc.tar.xz
zzz-8d943f2513085f540e3bcf8ac345ea8a391730cc.zip
Add server to init, update SynthDefs
classes/ZZZ.sc: Add a Server instance to the initialization process to be able to make use of its instance methods in subclasses of ZZZ. Add \ZZZGate, \ZZZClock and \ZZZClockKorg as new and more stream-lined implementations of gate and clock SynthDefs.
-rw-r--r--classes/ZZZ.sc20
1 files changed, 14 insertions, 6 deletions
diff --git a/classes/ZZZ.sc b/classes/ZZZ.sc
index 50cbe8b..24ba9a0 100644
--- a/classes/ZZZ.sc
+++ b/classes/ZZZ.sc
@@ -10,18 +10,26 @@ ZZZ{
< noteVoltageRangeMax = 7.0,
< noteCpsRangeMin = 4.088,
< noteCpsRangeMax = 16744.036;
- var <channels;
+ var <channels, <server;
*new{
- arg channels;
- ^super.newCopyArgs(channels);
+ arg channels, server;
+ ^super.newCopyArgs(channels, server);
}
*initClass{
StartUp.add{
- // adding SynthDef for clock
- SynthDef(\ZZZClock, { |out = 0, freq = 2, iphase = 0, width = 0.5, mul= 1.0|
- Out.ar(out, LFPulse.ar(freq, iphase, width, mul)-0.5);
+ SynthDef(\ZZZGate, {|bus = 0, in = 1.0, out = 0|
+ Out.ar(
+ out,
+ DC.ar(in: in) * In.kr(bus)
+ );
+ }).add;
+ SynthDef(\ZZZClock, { |out = 0, bus = 0, iphase = 0, width = 0.5, mul = 1.0, add = 0.0|
+ Out.ar(out, LFPulse.ar(In.kr(bus), iphase, width, mul, add));
+ }).add;
+ SynthDef(\ZZZClockKorg, { |out = 0, bus = 0, iphase = 0, width = 0.5, mul = 1.0, add = 0.0|
+ Out.ar(out, LFPulse.ar(In.kr(bus) * 2, iphase, width, mul, add));
}).add;
// adding SynthDef for constant notes
SynthDef(\ZZZConstant, { |out = 0, mul= 0.0|