hi
i am preparing an immersive video installation using pd-GEMG4 and need a little help. i would like to control the patch with midi using flash etc.. but i would like the slider to read from -360 to 360 is there a simple way to configure or scale an incoming midi ## 0-127 to -360to360
Thanks Patrick
Thanks
On Tuesday, December 16, 2003, at 04:32 PM, Marc Lavallée wrote:
On Tue, Dec 16, 2003 at 02:54:21PM -0500, shreeswifty wrote:
is there a simple way to configure or scale an incoming midi ## 0-127 to -360to360
( ( ( <midi value> * 720 ) + 1 ) / 127 ) - 360
-- Marc <0_127_to_-360_360.pd>
Keep in mind that you cannot get better resolution with note messages (0-127) so you will have bigger jumps in your scaled control values. (you could also interpolate on the receiving end)
you should probably use a controller (ctlin) which is not limited to 0-127 but has 14bit resolution (I think?)
I did have issues sending ctl data from max and reaktor to pd, it seems pd just sends midi data, while other apps scale and translate the values.
I think a handly abstraction would be one that scales the incoming range to a specified range automatically... has 4 args, the min and max of the input and the desired min and max. if no one else has bothered I'll patch on up myself.
B. ----- Original Message ----- From: "Marc Lavallée" odradek@videotron.ca To: "shreeswifty" bigswift@ufl.edu Cc: pd-list@iem.at Sent: Tuesday, December 16, 2003 4:32 PM Subject: Re: [PD] tight syncing of two pd machines...
On Tue, Dec 16, 2003 at 02:54:21PM -0500, shreeswifty wrote:
is there a simple way to configure or scale an incoming midi ## 0-127 to -360to360
( ( ( <midi value> * 720 ) + 1 ) / 127 ) - 360
-- Marc
hi,
someone on this list made this sub-patch for me a long time ago (gotta check the archives)
takes a message:
"remap <min_input> <max_input> <min_output> <max_output>"
cheers -andre
On Wed, 17 Dec 2003 10:24:19 -0500 "B. Bogart" ben@ekran.org wrote:
Keep in mind that you cannot get better resolution with note messages (0-127) so you will have bigger jumps in your scaled control values. (you could also interpolate on the receiving end)
you should probably use a controller (ctlin) which is not limited to 0-127 but has 14bit resolution (I think?)
I did have issues sending ctl data from max and reaktor to pd, it seems pd just sends midi data, while other apps scale and translate the values.
I think a handly abstraction would be one that scales the incoming range to a specified range automatically... has 4 args, the min and max of the input and the desired min and max. if no one else has bothered I'll patch on up myself.
B. ----- Original Message ----- From: "Marc Lavallée" odradek@videotron.ca To: "shreeswifty" bigswift@ufl.edu Cc: pd-list@iem.at Sent: Tuesday, December 16, 2003 4:32 PM Subject: Re: [PD] tight syncing of two pd machines...
On Tue, Dec 16, 2003 at 02:54:21PM -0500, shreeswifty wrote:
is there a simple way to configure or scale an incoming midi ## 0-127 to -360to360
( ( ( <midi value> * 720 ) + 1 ) / 127 ) - 360
-- Marc
PD-list mailing list PD-list@iem.at http://iem.at/cgi-bin/mailman/listinfo/pd-list
is it in the abstractions CVS?
B. ----- Original Message ----- From: "Andre Schmidt" huolong@arcor.de To: pd-list@iem.at Sent: Wednesday, December 17, 2003 12:41 PM Subject: Re: [PD] tight syncing of two pd machines...
hi,
someone on this list made this sub-patch for me a long time ago (gotta check the archives)
takes a message:
"remap <min_input> <max_input> <min_output> <max_output>"
cheers -andre
On Wed, 17 Dec 2003 10:24:19 -0500 "B. Bogart" ben@ekran.org wrote:
Keep in mind that you cannot get better resolution with note messages (0-127) so you will have bigger jumps in your scaled control values. (you could also interpolate on the receiving end)
you should probably use a controller (ctlin) which is not limited to 0-127 but has 14bit resolution (I think?)
I did have issues sending ctl data from max and reaktor to pd, it seems pd just sends midi data, while other apps scale and translate the values.
I think a handly abstraction would be one that scales the incoming range
to
a specified range automatically... has 4 args, the min and max of the
input
and the desired min and max. if no one else has bothered I'll patch on up myself.
B. ----- Original Message ----- From: "Marc Lavallée" odradek@videotron.ca To: "shreeswifty" bigswift@ufl.edu Cc: pd-list@iem.at Sent: Tuesday, December 16, 2003 4:32 PM Subject: Re: [PD] tight syncing of two pd machines...
On Tue, Dec 16, 2003 at 02:54:21PM -0500, shreeswifty wrote:
is there a simple way to configure or scale an incoming midi ## 0-127 to -360to360
( ( ( <midi value> * 720 ) + 1 ) / 127 ) - 360
-- Marc
PD-list mailing list PD-list@iem.at http://iem.at/cgi-bin/mailman/listinfo/pd-list
i made one called [scalenum] that i use all the time. -josh
I think a handly abstraction would be one that scales the incoming range to a specified range automatically... has 4 args, the min and max of the input and the desired min and max. if no one else has bothered I'll patch on up myself.
B.
there is also an object by shea ako called remap which does exactly what you want, I'll see if he has pd version ready for release.
http://www.hyperspasm.com/max/general/remap.png
At 13:45 -0800 17.12.03, Josh Steiner wrote:
i made one called [scalenum] that i use all the time. -josh
I think a handly abstraction would be one that scales the incoming range to a specified range automatically... has 4 args, the min and max of the input and the desired min and max. if no one else has bothered I'll patch on up myself.
B.
-- ____________________________________________________ independent u.s. drum'n'bass -- http://vitriolix.com
#N canvas 141 178 799 461 8; #X obj 22 376 outlet; #X floatatom 72 297 5 0 0 0 - - -; #X obj 22 18 inlet; #X floatatom 85 25 5 0 0 0 - - -; #X obj 71 96 $1; #X obj 44 56 t f b; #X obj 101 96 $2; #X obj 130 96 $3; #X obj 160 96 $4; #X obj 44 238 expr ((( $f1 - $f2 ) / ( $f3 - $f2 ) ) * ( $f5 - $f4 )) + $f4; #X connect 2 0 5 0; #X connect 3 0 5 0; #X connect 4 0 9 1; #X connect 5 0 9 0; #X connect 5 1 4 0; #X connect 5 1 6 0; #X connect 5 1 7 0; #X connect 5 1 8 0; #X connect 6 0 9 2; #X connect 7 0 9 3; #X connect 8 0 9 4; #X connect 9 0 1 0; #X connect 9 0 0 0;
Here's a new scalenum abstraction, based on Josh's abstraction and Martin's comment. I added inlets to change the input and output boundaries. It doesn't use "expr", but only "native" objects. When the boundaries are set, it works with one addition, one multiplication, and one substraction. I though about adding a min-max filter, but it would involve more calculation, so I'll leave that part as an exercise. :-)
Ben bogart wrote:
I think a handly abstraction would be one that scales the incoming range to a specified range automatically... has 4 args, the min and max of the input and the desired min and max.
Josh Steiner wrote:
i made one called [scalenum] that i use all the time.
Martin Peach wrote:
It will run faster if you work out 720/127 yourself at the beginning instead of forcing pd to compute it every time:
...
I am NaN (I am a free man!)
Marc
Hallo, Marc Lavallée hat gesagt: // Marc Lavallée wrote:
I though about adding a min-max filter, but it would involve more calculation, so I'll leave that part as an exercise. :-)
[clip $3 $4] | [outlet]
Frank Barknecht _ ______footils.org__
first idea that comes to mind:
0...127 | [ expr ((($f1 / 127) * 720) - 360) ] | -360...360
but IANM (i'm not a mathematician)...
shreeswifty wrote:
hi
i am preparing an immersive video installation using pd-GEMG4 and need a little help. i would like to control the patch with midi using flash etc.. but i would like the slider to read from -360 to 360 is there a simple way to configure or scale an incoming midi ## 0-127 to -360to360
Thanks Patrick
PD-list mailing list PD-list@iem.at http://iem.at/cgi-bin/mailman/listinfo/pd-list .
On Tue, Dec 16, 2003 at 04:20:41PM -0600, Eric Skogen wrote:
first idea that comes to mind:
0...127 | [ expr ((($f1 / 127) * 720) - 360) ] | -360...360
but IANM (i'm not a mathematician)...
You are right, I was wrong.
My idea was:
( ( ( <midi value> * 720 ) + 1 ) / 127 ) - 360
But it's actually:
( <midi value> * 720 / 127 ) - 360
or (without expr):
0...127 | [ * 720 ] | [ / 127 ] | [ - 360 ] | -360...360
Marc
Marc Lavallée wrote:
0...127 | [ * 720 ] | [ / 127 ] | [ - 360 ] | -360...360
It will run faster if you work out 720/127 yourself at the beginning instead of forcing pd to compute it every time:
0..127 | [ * 5.66929 ] | [ - 360 ] | -360...360
I am NaN (I am a free man!)
Martin