2 summary:: monophonic event stream
3 related:: Classes/Pbind, Classes/PmonoArtic
4 categories:: Streams-Patterns-Events>Patterns>Event
8 Plays one instance of a link::Classes/Synth::. The pattern pairs define changes in that one synth's controls. This node is created when entering a Pmono, and released when the Pmono terminates. There is just one node for the duration of the entire pattern, and it will sustain through each event. If a monophonic phrase requires staccato notes or re-articulation between some notes, see link::Classes/PmonoArtic::.
10 If event[\id] is not nil, Pmono simply directs its pattern changes to that node and does not create an extra synth.
15 p = Pmono(\default, \dur, 0.2, \freq, Pwhite(1,8) * 100 ).play
19 // multi channel expansion is supported:
20 p = Pmono(\default, \dur, 0.2, \freq, Pwhite(1,8) * 100, \detune, [0,2,5,1]).play
25 // the following example will end after 5 seconds
26 // or you can stop it sooner with a stop message
29 Pset(\detune,Pwhite(0,1.0) * [0,1,3,7],
31 Pmono(\default, \dur, 0.2, \freq, Pwhite(1,8) * 100 ),
32 Pmono(\default, \dur, 0.1, \freq, Pwhite(1,8) * 300)
40 subsection::A related approach
42 A related approach is to instantiate a Synth yourself and then set its values by using an link::Classes/Event:: whose "type" is code::\set::, as illustrated here. The user is responsible for ensuring proper synchronization between between link::Classes/Synth:: creation and pattern execution.
45 // First we create something to control
46 x = {|freq=440, amp=0.6| MoogFF.ar(PinkNoise.ar(amp), freq).dup}.play;
48 // In the following pattern, the first two keys are the ones that create the monophonic behaviour:
51 \type, \set, // This tells it we'll be setting parameters of an existing node...
52 \id, x.nodeID, // ...this tells it whose parameters we'll be setting
53 \args, #[\freq, \amp], // and this tells it which parameters to set
54 \freq, Pwhite(100, 1000),
56 \amp, Pseq((1,0.99 .. 0.1), inf)
64 For more details on the code::\set:: event type, see its description in Chapter 8, link::Tutorials/A-Practical-Guide/PG_08_Event_Types_and_Parameters##Event Types and Parameters:: of the Practical Guide To Patterns.
66 subsection::SynthDef variant support
68 SynthDefs allow alternate sets of default values to be defined (see "Variants" in link::Classes/SynthDef:: help). Most event patterns, such as Pbind, specify the variant using the variant key in the output events. (Note that variants are always optional.) In Pmono, the mechanism is different because the the SynthDef name, including variant suffix, must be known before evaluating the first event. So, the variant suffix is provided in the first Pmono argument:
71 Pmono('synthDefName.variant', pairs...)