Skip to content

Commit 2a0b884

Browse files
committed
Chuck addToTask fix. README+TaskFilter examples
1 parent 5951312 commit 2a0b884

4 files changed

Lines changed: 104 additions & 9 deletions

File tree

Classes/Chuck/Chuck.sc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ Chuck {
2121
^parentArgs;
2222
}
2323

24-
2524
clone { | childName |
2625
^this.new(childName, source, argsTemplate)
2726
}

Classes/Chuck/TaskPlayerOperators.sc

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ See: file:./ChainingTaskOperators.org
5757
}
5858

5959
addToTask { | task, play = false |
60+
task = task.asTaskPlayer(this);
6061
this.removePreviousTask;
6162
this.addNotifier(task, \beat, { this.play(task.dur) });
6263
this.addNotifier(task, \stop, { this.release });
@@ -78,11 +79,11 @@ See: file:./ChainingTaskOperators.org
7879
this.addToTask(task, play);
7980
}{
8081
filterTask = Tox("_" ++ taskName);
81-
[thisMethod.name, "adding ", task, "as parent to", filterTask].postln;
82+
// [thisMethod.name, "adding ", task, "as parent to", filterTask].postln;
8283
filterTask.addToTask(task).pattern_(xoPattern);
83-
[thisMethod.name, "the parent of ", filterTask, "is", filterTask.parent].postln;
84+
// [thisMethod.name, "the parent of ", filterTask, "is", filterTask.parent].postln;
8485
this.addToTask(filterTask, play);
85-
[thisMethod.name, filterTask, filterTask.parent, task].postln;
86+
// [thisMethod.name, filterTask, filterTask.parent, task].postln;
8687
};
8788
}
8889
}

MOTTO.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Canis plenus et libum soldum

README.org

Lines changed: 99 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
/Compact coding tools for SuperCollider, with Emacs Org-mode intergration/
44

5+
_Canis plenus et libum soldum_
6+
57
This is version 1.0alpha (=retiny=).
68

79
* Installation
@@ -18,6 +20,10 @@ This is version 1.0alpha (=retiny=).
1820
:END:
1921

2022
** Synth Processes and their parameters
23+
:PROPERTIES:
24+
:ID: 5A4BBD0F-7722-42C9-8E7D-50E3AACCAF34
25+
:eval-id: 6
26+
:END:
2127
Tiny-sc uses class =Chuck= to define containers that can run synths. It also defines some shortcuts for commonly used UGen combinations and patterns and for control UGen arugments such as amp, Pan and various envelopes. Chuck instances are accessed by their name. Playing a SynthDef function or a SynthDef name will start a new Synth and fade out the previous one:
2228

2329
#+BEGIN_SRC sclang
@@ -43,6 +49,10 @@ Pwhite(100, 200, inf) =>.freq \test;
4349
#+END_SRC
4450

4551
** Playing sequences of synth events
52+
:PROPERTIES:
53+
:ID: C169857C-C151-4D9B-8BC3-A588AD4FFE59
54+
:eval-id: 17
55+
:END:
4656
A Chuck can play with a duration pattern, which may be a single number:
4757

4858
#+BEGIN_SRC sclang
@@ -65,7 +75,11 @@ A Chuck can be driven by a TaskPlayer to run patterns in a similar way as Pbind.
6575

6676
#+BEGIN_SRC sclang
6777
{ SinOsc.arps(Rand(2000, 3000)).perc } => \twock; // => waits to be triggered
68-
\twock *> \test; // Also restarts the task player.
78+
\twock *> \test; // Also starts the task player if not playing
79+
#+END_SRC
80+
81+
#+BEGIN_SRC sclang
82+
\test *>.xooox___ \test;
6983
#+END_SRC
7084

7185
Remove chuck named =test= from its task - but leave the other Chucks still attached:
@@ -80,17 +94,70 @@ Stop the task, and all it's dependent Chucks:
8094
\test.stop;
8195
#+END_SRC
8296

97+
** Task Player filters
98+
:PROPERTIES:
99+
:ID: 33EC0959-E840-4DA0-9891-0692387E5332
100+
:eval-id: 194
101+
:END:
102+
103+
Feature is still experimental.
104+
105+
#+BEGIN_SRC sclang
106+
"default" => \high; // set source of chuck high
107+
Pwhite(70, 90, inf).midicps =>.freq \high; // set frequency pattern for high
108+
{ Blip.arps(Rand(100, 300), 3).perc } => \low; // set source of chuck low
109+
\high *> \low; // Make high follow task pattern of low
110+
\low *> 0.1; // Set and start task pattern of low to play beats at 0.1 seconds
111+
#+END_SRC
112+
113+
Let =high= play a sub-pattern of the TaskPlayer =low=.
114+
115+
- x :: play new note.
116+
- o :: stop note, remain silent.
117+
- _ :: hold previous note (do not release).
118+
119+
#+BEGIN_SRC sclang
120+
\high *>.xooox___x_x_x_xx \low; // creates filter \_low and attaches chuck \high to it
121+
#+END_SRC
122+
123+
Change the duration pattern of master Task =low=:
124+
125+
#+BEGIN_SRC sclang
126+
\low *> Prand([Pn(0.08, 4), 0.3], inf);
127+
#+END_SRC
128+
129+
Make both =high= and =low= play on the same filter of =low= Task;
130+
#+BEGIN_SRC sclang
131+
\high *>.xooox___xx_x_xxxx \low; // create filter \_low and attaches chuck \low to it
132+
\low *> \_low; // also make chuck low follow filter \_low
133+
#+END_SRC
134+
135+
Change base beat pattern and reset =low= to that root pattern:
136+
#+BEGIN_SRC sclang
137+
\low *> 0.2;
138+
#+END_SRC
139+
140+
Change base beat pattern again:
141+
#+BEGIN_SRC sclang
142+
\low *> Prand([Pn(0.12, 4), 0.3, 0.6, Pn(0.06, 2)], inf);
143+
#+END_SRC
144+
145+
Synch chuck =low= with chuck =high= again:
146+
#+BEGIN_SRC sclang
147+
\low *> \_low; // also make chuck low follow filter \_low
148+
#+END_SRC
149+
83150
** Linking audio inputs and outputs between synths
84151
:PROPERTIES:
85152
:ID: EA903FD5-9FE9-4B0A-BEE0-B38C8807810E
86-
:eval-id: 4
153+
:eval-id: 20
87154
:END:
88155
Finally, the audio output of a Chuck can be linked to the input of another Chuck. Many-to-one and one-to-many audio link configurations are possible. The library deals with bus allocation and synth order management in the background, by responding to a linking request (using operator '=>').
89156

90157
Start a source and an effect:
91158
#+BEGIN_SRC sclang
92159
{ PinkNoise.ar(0.1) } ==> \source;
93-
{ Resonz.arps(In.ar(\in.kr(0)) * 500, LFNoise0.kr(30).range(400, 2000), 0.001) } ==> \effect;
160+
{ Resonz.arp(In.ar(\in.kr(0)) * 500, LFNoise0.kr(30).range(400, 2000), 0.001) } ==> \effect;
94161
#+END_SRC
95162

96163
Link the source to the effect:
@@ -104,16 +171,43 @@ Unlink the source from the effect, and send it back to default output:
104171
\source.toRoot;
105172
#+END_SRC
106173

107-
Stop both source and effect:
174+
#+BEGIN_SRC sclang
175+
{ In.ar(\in.kr) * 3 * Decay2.kr(Dust.kr([1, 1]), 0.1, 1.5) } ==> \effect2;
176+
#+END_SRC
177+
178+
Create audio link chain: source -> effect -> effect;
179+
180+
#+BEGIN_SRC slcang
181+
\source => \effect;
182+
\effect => \effect2;
183+
#+END_SRC
184+
185+
Make effect send directly to output again:
186+
#+BEGIN_SRC sclang
187+
\effect.toRoot;
188+
#+END_SRC
189+
190+
Make source send to both effect and effect2
191+
#+BEGIN_SRC sclang
192+
\source => \effect2;
193+
#+END_SRC
194+
195+
Keep source sending to effect and effect2, and add effect to send to effect2:
196+
#+BEGIN_SRC sclang
197+
\effect => \effect2;
198+
#+END_SRC
199+
200+
Stop source and effects:
108201
#+BEGIN_SRC sclang
109202
\source.release;
110203
\effect.release;
204+
\effect2.release;
111205
#+END_SRC
112206

113207
** Multiple voice example
114208
:PROPERTIES:
115209
:ID: CDEFFE5C-E976-4D0C-9983-A5E27467AB0F
116-
:eval-id: 5
210+
:eval-id: 11
117211
:END:
118212

119213
Just a demo with 8 Chuck instances playing on 8 different TaskPlayers.

0 commit comments

Comments
 (0)