I'm writing a patch in which a MIDI keyboard controls a series of pitch-shifters.For example, pressing the middle C key would open up the pitch shifter 61-shift, with the relative volume of its output set by the velocity of the "note in" message.
It seems to me that the easiest way to do this, if possible, would be to have each pitch-shifter fed by a different receive object. Thus, a notein with note 61, velocity 64, and channel 1 would send the message "64" to the receive named "61-receive".
Ideally, this would require having a message inlet change the destination of a send object. It would be something like (and I know this doesn't work) "send $1-receive $2", where $1 was the note and $2 was the velocity.
Can something akin to this be done? I've tried different ways without success, checked the various docs, and even tried to read the source code to the send object (which I admit not comprehending at all).
Thanks for any clues.
hi, the dynamically sending is done with a message beginning with a semicolon (;). a semicolon changes the destination of a message to the symbol following the semicolon: [;fred 999( would send the number 999 to the (receive-)object fred. the semicolons clears the "current destination" (usually the outlet of the message objct) and redirects messages to the object "fred". the destination must be a symbol, ... with [pack s 0] you can go innto a message [;$1 $2( and the $1 will be replaced with the destination-symbol and the $2 with a float (or what you will want to send). marius.
----- Original Message ----- From: "Joseph Zitt" jzitt@josephzitt.com To: pd-list@iem.kug.ac.at Sent: Monday, June 10, 2002 2:40 AM Subject: [PD] Varying a "send" destination
I'm writing a patch in which a MIDI keyboard controls a series of pitch-shifters.For example, pressing the middle C key would open up the pitch shifter 61-shift, with the relative volume of its output set by the velocity of the "note in" message.
It seems to me that the easiest way to do this, if possible, would be to have each pitch-shifter fed by a different receive object. Thus, a notein with note 61, velocity 64, and channel 1 would send the message "64" to the receive named "61-receive".
Ideally, this would require having a message inlet change the destination of a send object. It would be something like (and I know this doesn't work) "send $1-receive $2", where $1 was the note and $2 was the velocity.
Can something akin to this be done? I've tried different ways without success, checked the various docs, and even tried to read the source code to the send object (which I admit not comprehending at all).
Thanks for any clues.
-- | josephzitt@josephzitt.com http://www.josephzitt.com/ | | http://www.metatronpress.com/jzitt/ http://www.mp3.com/josephzitt/ | | == New book: Surprise Me with Beauty: the Music of Human Systems == | | Comma / Gray Code Silence: the John Cage Discussion List |
On Mon, 2002-06-10 at 02:30, sme wrote:
hi, the dynamically sending is done with a message beginning with a semicolon (;). a semicolon changes the destination of a message to the symbol following the semicolon: [;fred 999( would send the number 999 to the (receive-)object fred. the semicolons clears the "current destination" (usually the outlet of the message objct) and redirects messages to the object "fred". the destination must be a symbol, ... with [pack s 0] you can go innto a message [;$1 $2( and the $1 will be replaced with the destination-symbol and the $2 with a float (or what you will want to send).
Hmmm.... when I try to create an object "; $1 $2" (also trying it with $1-r and $1r, with and without the space after the semicolon, and with and without explicitly putting that "(" after the "$2"), I get a "couldn't create" message in the console window. Am I misunderstanding something about the notation?
Yep, you need a "message", not an "object".
cheers Miller
On Mon, Jun 10, 2002 at 05:38:16PM -0400, Joseph Zitt wrote:
On Mon, 2002-06-10 at 02:30, sme wrote:
hi, the dynamically sending is done with a message beginning with a semicolon (;). a semicolon changes the destination of a message to the symbol following the semicolon: [;fred 999( would send the number 999 to the (receive-)object fred. the semicolons clears the "current destination" (usually the outlet of the message objct) and redirects messages to the object "fred". the destination must be a symbol, ... with [pack s 0] you can go innto a message [;$1 $2( and the $1 will be replaced with the destination-symbol and the $2 with a float (or what you will want to send).
Hmmm.... when I try to create an object "; $1 $2" (also trying it with $1-r and $1r, with and without the space after the semicolon, and with and without explicitly putting that "(" after the "$2"), I get a "couldn't create" message in the console window. Am I misunderstanding something about the notation?
-- | josephzitt@josephzitt.com http://www.josephzitt.com/ | | http://www.metatronpress.com/jzitt/ http://www.mp3.com/josephzitt/ | | == New book: Surprise Me with Beauty: the Music of Human Systems == | | Comma / Gray Code Silence: the John Cage Discussion List |
On Mon, 2002-06-10 at 17:48, Miller Puckette wrote:
Yep, you need a "message", not an "object".
D'oh! Yep, the message works just fine!
Hmmm.... when I try to create an object "; $1 $2" (also trying it with $1-r and $1r, with and without the space after the semicolon, and with and without explicitly putting that "(" after the "$2"), I get a "couldn't create" message in the console window. Am I misunderstanding something about the notation?
Hi, Joseph Zitt hat gesagt: // Joseph Zitt wrote:
It seems to me that the easiest way to do this, if possible, would be to have each pitch-shifter fed by a different receive object. Thus, a notein with note 61, velocity 64, and channel 1 would send the message "64" to the receive named "61-receive".
Ideally, this would require having a message inlet change the destination of a send object. It would be something like (and I know this doesn't work) "send $1-receive $2", where $1 was the note and $2 was the velocity.
It's easy, if you saw it once: You can send messages out of messages if you build a message starting with ";".
You probably did this a lot already with [; pd dsp 1(. Dynamic messages can be done in the same way, see attached patch.
Frank Barknecht _ ______footils.org__
Forgot to attach the patch, sorry
<but> I sometimes hate using Mutt, because on a german keyboard the send key ("y") is right next to the attach key ("a"), we Germans have "z" and "y" switched... </but>
Frank Barknecht _ ______footils.org__
if you're running PD on linux, you could also check out the latest version of the "ext13" library. it contains "send13" and "receive13" that allow a "set"- argument to change its name.
oliver
10.06.02 02:40:18, Joseph Zitt jzitt@josephzitt.com wrote:
I'm writing a patch in which a MIDI keyboard controls a series of pitch-shifters.For example, pressing the middle C key would open up the pitch shifter 61-shift, with the relative volume of its output set by the velocity of the "note in" message.
It seems to me that the easiest way to do this, if possible, would be to have each pitch-shifter fed by a different receive object. Thus, a notein with note 61, velocity 64, and channel 1 would send the message "64" to the receive named "61-receive".
Ideally, this would require having a message inlet change the destination of a send object. It would be something like (and I know this doesn't work) "send $1-receive $2", where $1 was the note and $2 was the velocity.
Can something akin to this be done? I've tried different ways without success, checked the various docs, and even tried to read the source code to the send object (which I admit not comprehending at all).
Thanks for any clues.
-- | josephzitt@josephzitt.com http://www.josephzitt.com/ | | http://www.metatronpress.com/jzitt/ http://www.mp3.com/josephzitt/ | | == New book: Surprise Me with Beauty: the Music of Human Systems == | | Comma / Gray Code Silence: the John Cage Discussion List |
On Mon, 2002-06-10 at 05:52, oliver wrote:
if you're running PD on linux, you could also check out the latest version of the "ext13" library. it contains "send13" and "receive13" that allow a "set"- argument to change its name.
Ah, thanks! And I see that there's also a Windows version at http://pd.klingt.org/files/ . (I;ve also downloaded your loopool from there, which looks very cool.)