Forums > MaxMSP

NRPN, bits and all this..

February 10, 2008 | 1:50 pm

hi

I am using, inside the vst~ object, a plug-in which i can (and want)
to control by NRPN , in order to have a much more precise control

The plug-in is OHMForce’s QuadFrohmage Filter ( a really great
filter!!) – and I have the list of NRPNs
All is fine, I have no trouble accessing the controls, using
midievent messge(s).

The trouble is that I don’t really know what all those NRPNs and bits
are – my midi knowledge is very much MAX only, and so far I did not
have much use for NRPN

__so, from what the OhmForce’s manual says, their plug-in have

"16384 possible NRPN’s, each one
having a 14 bit value (i.e. a value between
0 and 16383). The system uses 4 prede-
fined MIDI CC’s.
Data is sent to the MIDI
device in two phases : first the NRPN num-
ber, and then the NRPN value."

I know how to access the NRPN number – and also how to send the
value, but only using 2 (midi, 0-127) values

I would like to send ONE (0-16384) value…

how to translate this ONE (0-16384) value into 2 (midi, 0-127) values???

(I kind of suspect it is close to using [< < 7] in reverse…. so it
could be [>> 7] but.. but it’s quite unclear to me – why 7, how to
access all 16384 values, etc etc)

any light would be welcome

many thanks

kasper


________________________

Kasper T. Toeplitz
noise, composition, bass, computer
________________________

33/35 rue des Panoyaux
75020 PARIS
FRANCE

t: home +(33) (0)1 40 02 08 91
mob +(33) (0)6 63 42 85 34

e-mail: kasper@club-internet.fr
kasper@free.fr

http://www.sleazeArt.com

http://www.myspace.com/sleazeart
________________________


February 10, 2008 | 2:40 pm

Here it is fairly clear explained:

http://www.borg.com/~jglatt/tutr/rpn.htm

In max it could be done like below. The 7 is because midi-values are limited to 7 bits.

_
johan

#P window setfont "Sans Serif" 9.;
#P number 222 241 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 192 267 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P window linecount 1;
#P newex 222 219 39 196617 & 127;
#P newex 192 219 29 196617 >> 7;
#P newex 192 189 27 196617 t i i;
#P number 128 241 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 108 267 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 108 109 50 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 108 210 50 196617 xbendin2;
#P newex 108 191 50 196617 xbendout;
#P connect 2 0 0 0;
#P connect 2 0 5 0;
#P connect 6 0 8 0;
#P connect 7 0 9 0;
#P connect 5 1 7 0;
#P connect 5 0 6 0;
#P connect 1 1 4 0;
#P connect 1 0 3 0;
#P connect 0 0 1 0;
#P window clipboard copycount 10;



kjg
February 10, 2008 | 2:56 pm

here you go:

#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P comment 111 189 30 196617 MIDI;
#P number 70 345 42 9 0 0 160 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P user hslider 70 311 23 335 16384 1 0 0;
#P comment 113 281 279 196617 recreate original 14 bit value out of the two 7 bit streams;
#P number 143 115 43 9 0 0 160 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 78 115 43 9 0 0 160 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 172 64 43 9 0 0 160 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P comment 176 93 188 196617 < < split into two 7 bit (0-127) values;
#P comment 187 136 30 196617 LSB;
#P newex 70 155 40 196617 change;
#P number 70 64 100 9 0 0 2208 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 70 281 27 196617 +;
#P newex 87 260 29 196617 < < 7;
#P number 135 134 51 9 0 0 2208 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 135 92 40 196617 % 128;
#P number 70 134 51 9 0 0 2208 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 70 92 29 196617 >> 7;
#P user hslider 70 35 23 335 16384 1 0 0;
#P comment 66 205 125 196617 send over midi as two CCs;
#P user panel 56 182 144 61;
#X brgb 191 191 191;
#X frgb 0 0 0;
#X border 1;
#X rounded 0;
#X shadow 0;
#X done;
#P comment 40 135 30 196617 MSB;
#P comment 219 66 135 196617 < < 14 bit value (0-16383);
#P connect 4 0 11 0;
#P connect 11 0 5 0;
#P connect 5 0 6 0;
#P connect 6 0 12 0;
#P fasten 8 0 10 0 140 250 75 250;
#P lcolor 1;
#P connect 10 0 19 0;
#P connect 19 0 20 0;
#P connect 5 0 16 0;
#P connect 12 0 9 0;
#P lcolor 1;
#P connect 9 0 10 1;
#P connect 11 0 7 0;
#P connect 7 0 8 0;
#P connect 7 0 17 0;
#P connect 4 0 15 0;
#P pop;


February 10, 2008 | 3:21 pm

>Here it is fairly clear explained:
>http://www.borg.com/~jglatt/tutr/rpn.htm
>
>In max it could be done like below. The 7 is because midi-values are
>limited to 7 bits.
>

many thanks

I did not knew the [&] object – it now makes total sense

best

kasper

Kasper T. Toeplitz
noise, composition, bass, computer

http://www.sleazeArt.com

http://www.myspace.com/sleazeart



kjg
February 10, 2008 | 3:23 pm

there was a little problem in what I originally posted, caused by the change object
128 would be decoded as 0, 256 as 128 etcetera.

again:

#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P comment 114 171 30 196617 MIDI;
#P number 70 322 42 9 0 0 160 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P user hslider 70 288 23 335 16384 1 0 0;
#P comment 149 243 279 196617 recreate original 14 bit value out of the two 7 bit streams;
#P number 143 114 43 9 0 0 160 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 78 114 43 9 0 0 160 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 172 64 43 9 0 0 160 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P comment 176 92 188 196617 < < split into two 7 bit (0-127) values;
#P comment 187 135 30 196617 LSB;
#P number 70 64 100 9 0 0 2208 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 70 258 27 196617 +;
#P newex 70 232 29 196617 < < 7;
#P number 135 133 51 9 0 0 2208 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 135 91 40 196617 % 128;
#P number 70 133 59 9 0 0 2208 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 70 91 29 196617 >> 7;
#P user hslider 70 35 23 335 16384 1 0 0;
#P comment 69 187 125 196617 send over midi as two CCs;
#P user panel 59 164 144 61;
#X brgb 191 191 191;
#X frgb 0 0 0;
#X border 1;
#X rounded 0;
#X shadow 0;
#X done;
#P comment 40 134 30 196617 MSB;
#P comment 219 66 135 196617 < < 14 bit value (0-16383);
#P connect 4 0 11 0;
#P connect 11 0 5 0;
#P connect 5 0 6 0;
#P connect 6 0 9 0;
#P connect 9 0 10 0;
#P connect 10 0 18 0;
#P connect 18 0 19 0;
#P connect 5 0 15 0;
#P fasten 8 0 10 1 140 253 92 253;
#P connect 11 0 7 0;
#P connect 7 0 8 0;
#P connect 7 0 16 0;
#P connect 4 0 14 0;



kjg
February 10, 2008 | 3:30 pm

> I did not knew the [&] object

o yes. that’s probably the better way in this case – [& 127] instead of [% 128]. clearer, and probably a bit cheaper cpu-wise, too?

Regards,
Klaas-Jan


February 10, 2008 | 9:10 pm


February 10, 2008 | 9:12 pm

Tiens, il est neuf heures.


Viewing 8 posts - 1 through 8 (of 8 total)