File: PatternConductor.schelp

package info (click to toggle)
supercollider 1%3A3.13.0%2Brepack-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 80,292 kB
  • sloc: cpp: 476,363; lisp: 84,680; ansic: 77,685; sh: 25,509; python: 7,909; makefile: 3,440; perl: 1,964; javascript: 974; xml: 826; java: 677; yacc: 314; lex: 175; objc: 152; ruby: 136
file content (57 lines) | stat: -rw-r--r-- 1,911 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
class:: PatternConductor
summary:: Simple interactive control for playing patterns
related:: Classes/Pattern
categories:: Streams-Patterns-Events>Patterns

description::

PatternConductor provides a simple interactive control (supporting play, pause, resume, stop) for playing pattern, much like link::Classes/Pattern#-play::. However, PatternConductor creates its own clock and directly controls the release of sounding notes as well as their initiation by the pattern.

InstanceMethods::

private::prPlay

method::tempo
Sets the tempo of the PatternConductor

method::play
Play the pattern. A link::Classes/TempoClock:: is created, its tempo is set to the PatternConductor tempo, and the pattern is played using that clock. If quant is non-zero, this is synchronized with TempoClock.default at the specified quantization.

method::pause
Pause the pattern, sustaining notes indefinitely. A subsequent link::#-resume:: will return to the original tempo (so the notes will end as scheduled). A subsequent link::#-play:: will cut-off any sounding notes and resume play at the original tempo.

method::stop
can cut-off or shorten sounding notes, depending on the value of tempo. If stopTempo is nil, all notes are cut-off immediately. Otherwise, notes end at the specified tempo.

Examples::

code::
(
// a pattern with long notes
p = Pbind(
	\freq, Pwhite(0,log(32)).exp.round(1) * 36.midicps,
	\detune, Pfunc({ | ev | ev[\freq]  * rand(0.01) }),
	\sustain, Pwhite(log(0.1), log(20)).exp,
	\dur, Prand([0.1,0.1,0.1,0.1,0.2,1,2],inf),
	\db, Pstep(Pseq([-20,-30,-25,-30], inf),0.2)
);

// unrelated cluster pattern running on TempoClock.default
Pbind(\dur,2, \midinote, Pseq([(48..60)],20), \db, -30).play;

// make a conductor
a = PatternConductor(p, quant: 2);
a.play;
)


// now try some interactive control options line by line:
a.quant = 0;
a.pause;
a.resume;
a.stop;
a.play;
a.pause;
a.play;
a.stop(1000);
::