Discussion:
Pbindef and Pmono \arguments
joesh
2014-09-20 16:12:57 UTC
Permalink
Hi I've been looking at the Pmono and Pbindef objects - as
suggested/discussed in this thread: args and SynthDefs
<http://new-supercollider-mailing-lists-forums-use-these.2681727.n2.nabble.com/arg-and-synthDefs-td7613457.html#a7613481>

I notice that to trigger various elements in a 'Pmono' or 'Pbindef' you need
to add an argument - ex: \dur for duration. However, how do we now which
arguments can be used, clearly I cannot add \coffeMakingMachine as this
won't be recognised. Is there a list somewhere of which arguments can be
used for each object?

/If all this is too vague I can be more precise for each object - I realise
there's a difference between the 'Pmono' and 'Pbindef' arguments system./


Thanks in advance - Joe




--
View this message in context: http://new-supercollider-mailing-lists-forums-use-these.2681727.n2.nabble.com/Pbindef-and-Pmono-arguments-tp7613484.html
Sent from the SuperCollider Users New (Use this!!!!) mailing list archive at Nabble.com.

_______________________________________________
sc-users mailing list

info (subscription, etc.): http://www.beast.bham.ac.uk/research/sc_mailing_lists.shtml
archive: http://www.listarc.bham.ac.uk/marchives/sc-users/
search: http://www.listarc.bham.ac.uk/lists/sc-users/search/
Edward Nixon
2014-09-20 16:37:46 UTC
Permalink
I think you need to go through the Patterns tutorial material. While what you are looking for is likely found in the information about the “Default Event” there’s a wealth of other stuff that really needs to be, at least familiar, in order to get the most out of patterns. I think this is a link to the first entry on the web; you’ll find the same material in the SC help system under Tutorials and/or Guides.

http://doc.sccode.org/Tutorials/Streams-Patterns-Events1.html

…edN
Post by joesh
Hi I've been looking at the Pmono and Pbindef objects - as
suggested/discussed in this thread: args and SynthDefs
<http://new-supercollider-mailing-lists-forums-use-these.2681727.n2.nabble.com/arg-and-synthDefs-td7613457.html#a7613481>
I notice that to trigger various elements in a 'Pmono' or 'Pbindef' you need
to add an argument - ex: \dur for duration. However, how do we now which
arguments can be used, clearly I cannot add \coffeMakingMachine as this
won't be recognised. Is there a list somewhere of which arguments can be
used for each object?
/If all this is too vague I can be more precise for each object - I realise
there's a difference between the 'Pmono' and 'Pbindef' arguments system./
Thanks in advance - Joe
--
View this message in context: http://new-supercollider-mailing-lists-forums-use-these.2681727.n2.nabble.com/Pbindef-and-Pmono-arguments-tp7613484.html
Sent from the SuperCollider Users New (Use this!!!!) mailing list archive at Nabble.com.
_______________________________________________
sc-users mailing list
info (subscription, etc.): http://www.beast.bham.ac.uk/research/sc_mailing_lists.shtml
archive: http://www.listarc.bham.ac.uk/marchives/sc-users/
search: http://www.listarc.bham.ac.uk/lists/sc-users/search/
joesh
2014-09-20 20:43:40 UTC
Permalink
Thanks, that probably exactly what I'm looking for, I hadn't thought about
the tutorial section of SC!



--
View this message in context: http://new-supercollider-mailing-lists-forums-use-these.2681727.n2.nabble.com/Pbindef-and-Pmono-arguments-tp7613484p7613487.html
Sent from the SuperCollider Users New (Use this!!!!) mailing list archive at Nabble.com.

_______________________________________________
sc-users mailing list

info (subscription, etc.): http://www.beast.bham.ac.uk/research/sc_mailing_lists.shtml
archive: http://www.listarc.bham.ac.uk/marchives/sc-users/
search: http://www.listarc.bham.ac.uk/lists/sc-users/search/
patrick
2014-09-20 20:56:39 UTC
Permalink
I think this is what you are looking for:

http://doc.sccode.org/Tutorials/A-Practical-Guide/PG_08_Event_Types_and_Parameters.html
<http://doc.sccode.org/Tutorials/A-Practical-Guide/PG_08_Event_Types_and_Parameters.html>

Patrick



--
View this message in context: http://new-supercollider-mailing-lists-forums-use-these.2681727.n2.nabble.com/Pbindef-and-Pmono-arguments-tp7613484p7613488.html
Sent from the SuperCollider Users New (Use this!!!!) mailing list archive at Nabble.com.

_______________________________________________
sc-users mailing list

info (subscription, etc.): http://www.beast.bham.ac.uk/research/sc_mailing_lists.shtml
archive: http://www.listarc.bham.ac.uk/marchives/sc-users/
search: http://www.listarc.bham.ac.uk/lists/sc-users/search/
Daniel Mayer
2014-09-20 21:12:51 UTC
Permalink
Edward is right, the Pattern Guide is worth going through and will
cover a lot of open questions.

Concerning your specific question about possible keys in event patterns:

1.) If the event pattern is employing an 'added' SynthDef arg names
of the SynthDef can be used for setting (e.g. 'freq', 'out', 'width' etc.)

2.) There's a number of keywords specific to the event mechanism such as
'midinote' (is converted to 'freq' automatically), 'dur', 'legato' etc.
You will find the most relevant in PG 07 and PG 08.
To my knowledge there's no complete list or no straight way
to get a complete list of them with a single command -
though this has been required by people sometimes.
If you're brave you might snoop the source file Event.sc and look
at various Event types and conversion calculations without changing anything.

From (1) and (2) it becomes clear that you shouldn't take a keyword
like 'dur' or 'midinote' as name for a SynthDef arg, it would be misunderstood
as Event keyword when playing an Event with this instrument.

There's another point that might be surprising and has a great potential,
making Event patterns to deferred little programs:

3.) You are free to add *any* key to a Pbind, Pmono etc !
That way relations between values of Events can be established,
Values are calculated in order (at time of played event) and might refer to
prior values (of the same event or even something outside),
so an arbitrarily long sequence of commands can be defined within them, here a short example:

(
Pbind(
\dur, 0.15,
\vegetable, Prand([\tomato, \salad, \potato], 30),
\freq, Pkey(\vegetable).collect { |v| v.switch(\tomato, 400, \salad, 500, \potato, 600) }
).play
)

Concerning differences between Pmono, Pbind and Pbindef:

What distinguishes Pmono from Pbind is that
a played Pmono results in an EventStreamPlayer which
is setting one single synth with each event,
whereas the EventStreamPlayer resulting from Pbind
(normally, with default event type \note) is
generating one synth per event (or even more synths, e.g. for arrays of pitches).
The task of Pmono can be done with Pbind but than the
event type \set has to be used (PG 07) and the synth has to
be started explicitely.

The special feature of Pbindef is possible replacement of all
single value streams without defining Pdefn for all of them.

There's no Pmonodef or such, so to use Pbindef in this
specific example requires event type \set


(
SynthDef(\sine, { |freq = 400, amp = 0.5|
Out.ar(0, SinOsc.ar(freq, mul: amp))
}).add
)


// start synth silently

a = Synth(\sine, [\amp, 0])


// play Pbindef
// synth to be set must be listed (\id), might be Synth object or node id
// args to be set must be listed

(
Pbindef(\x,
\type, \set,
\id, a,
\args, [\freq, \amp],
\dur, 1/6,
\amp, Prand([0.05, 0.2], inf),
\midinote, Pseq([60, 62, 64, 67], inf)
).play
)


// replacement a la Pbindef

Pbindef(\x, \midinote, Pxrand([60, 62, 64, 67, 71], inf))


// can be more in once

(
Pbindef(\x,
\midinote, Pxrand([61, 63, 67, 69, 77], inf),
\dur, Pwrand([1/6, 1/3], [0.8, 0.2], inf)
)
)

// stop setting by Pbindef

Pbindef(\x).stop;


// stop sound synth

a.free;


Also Pbindef is different from Pmono/Pbind in that regard that
it is the Pattern and the playing object (EventStreamPlayer) in one.

If this sounds confusing stay with Pbind and Pmono first and
see concepts and examples of Patterns/Streams/EventStreamPlayers
in the Pattern Guide.


Greetings

Daniel

-----------------------------
www.daniel-mayer.at
-----------------------------








_______________________________________________
sc-users mailing list

info (subscription, etc.): http://www.beast.bham.ac.uk/research/sc_mailing_lists.shtml
archive: http://www.listarc.bham.ac.uk/marchives/sc-users/
search: http://www.listarc.bham.ac.uk/lists/sc-users/search/
Daniel Mayer
2014-09-20 22:50:27 UTC
Permalink
Post by Daniel Mayer
The task of Pmono can be done with Pbind but than the
event type \set has to be used (PG 07) and the synth has to
be started explicitely.
... it's PG 08 as Patrick said.

Regards

Daniel

-----------------------------
www.daniel-mayer.at
-----------------------------

_______________________________________________
sc-users mailing list

info (subscription, etc.): http://www.beast.bham.ac.uk/research/sc_mailing_lists.shtml
archive: http://www.listarc.bham.ac.uk/marchives/sc-users/
search: http://www.listarc.bham.ac.uk/lists/sc-users/search/
joesh
2014-09-21 07:26:20 UTC
Permalink
I'll follow up the 'PG 08' link, I already had a quick look and that's
exactly what I was looking for. Secondly, I now understand that these are
'events' not arguments. This of course helps as it makes it easier to look
up stuff in the help section - searching arguments, as you can imagine, led
me nowhere, hence the question here on the forum.

Daniel - thanks again for the detailed information, I'll run all of these
which are great examples, just like the first ones from the last thread
which helped a lot.

A big thanks everyone, more than enough info to be getting along with.



--
View this message in context: http://new-supercollider-mailing-lists-forums-use-these.2681727.n2.nabble.com/Pbindef-and-Pmono-arguments-tp7613484p7613496.html
Sent from the SuperCollider Users New (Use this!!!!) mailing list archive at Nabble.com.

_______________________________________________
sc-users mailing list

info (subscription, etc.): http://www.beast.bham.ac.uk/research/sc_mailing_lists.shtml
archive: http://www.listarc.bham.ac.uk/marchives/sc-users/
search: http://www.listarc.bham.ac.uk/lists/sc-users/search/
James Harkins
2014-09-21 07:32:27 UTC
Permalink
On Sat, 20 Sep 2014 23:12:51 +0200
Post by Daniel Mayer
Edward is right, the Pattern Guide is worth going through and will
cover a lot of open questions.
Edward linked to the old Streams-Patterns-Event help, which is not the
pattern guide. The URL to the Practical Guide to Patterns is:

http://doc.sccode.org/Tutorials/A-Practical-Guide/PG_01_Introduction.html
Post by Daniel Mayer
There's no Pmonodef or such, so to use Pbindef in this
specific example requires event type \set
There's a trick for that. With Pchain, you can effectively "wrap" a
Pbindef within a Pmono or PmonoArtic. As long as the Pmono is the last
pattern to evaluate (i.e., first in the Pchain list), it will act like
Pmono. The other values can come from anywhere (including from Pbindef).

(
p = Pchain(
PmonoArtic(\default, \dummyArg, 0),
Pbindef(\mono,
\degree, Pn(Pseries({ rrand(-3, 3) }, 1, { rrand(5,
10) }), inf), \dur, 0.125,
\legato, Pseq([Pn(1.01, { rrand(3, 8) }), 0.01], inf)
)
).play;
)

Pbindef(\mono, \dur, Pwrand([0.125, 0.25], [0.9, 0.1], inf));

p.stop;

hjh




_______________________________________________
sc-users mailing list

info (subscription, etc.): http://www.beast.bham.ac.uk/research/sc_mailing_lists.shtml
archive: http://www.listarc.bham.ac.uk/marchives/sc-users/
search: http://www.listarc.bham.ac.uk/lists/sc-users/search/

Loading...