Forums > MaxMSP

stuck notes with poly~

April 12, 2007 | 2:55 pm

Hi, I was wondering if anyone can help me with a MIDI problem. I’ve built a patch that includes several synth modules and for some reason I keep getting stuck notes or notes that don’t sound. As a result I have close and its very annoying. I am using poly~, which I think generates note offs automatically. Its just the occassional missed or stuck note so i’m not sure how to fix it.
Thanks for any advice.
Steve



jml
April 13, 2007 | 1:41 am

are you using [midinote] messages?
are you utilizing thispoly~?
are you using adsr~ as a quick-fix for internally updating poly~?

please see poly~’s help file; also try to give us more info so that we can help you out.

jl


April 13, 2007 | 11:00 am

Hi, I am using adsr~ with thispoly~ as a quick fix for internally updating poly~. I have no midinote messages, just a notein to connect my midi keyboard.
I’m using target0 and steel messages connected to the poly~’s first inlet.
To get the note and velocity into poly~, I packed them and then connected to a prepend with an argumnet, "midinote" then inside poly~ i unpacked them and sent pitch to the oscillators and velocity to adsr~.
It seems to be working fine, just a note wil get stuck or it doesn’t sound and I have to close the patch.
Thank you for your reply,
Steve



jml
April 15, 2007 | 7:08 am

it’d be better if you could post your patch so i could help you out with a concrete example.

jl



jml
April 15, 2007 | 6:26 pm

without seeing an example,
i can only tell you that you’ll want to use midinote messages directly to poly~, and that you don’t need to be targeting if you are wanting to utilize poly~’s steal function.

jl


April 16, 2007 | 1:27 pm

I looked into using midinote messages but i’m using notein so I don’t really understnd the point of this. I’ve included a poly~ patch and subpatch that shows how I set this up. I used a target0 message to send new adsr values to all voices.
Thanks,
Steve

max v2;
#N vpatcher 784 147 1364 550;
#P origin 65 0;
#P window setfont "Sans Serif" 9.;
#P newex 73 32 48 196617 loadbang;
#P newex 375 117 27 196617 t i b;
#P newex 323 117 27 196617 t i b;
#P newex 273 117 27 196617 t i b;
#P newex 226 117 27 196617 t i b;
#P newex 323 138 40 196617 / 127.;
#P user dial 375 70 27 27 128 5 0 0 159 270 1 1. 170 170 170 221 221 221 120 120 120 225 225 225 0 0 0 0 0 0;
#P comment 370 57 40 196617 release;
#P user dial 323 70 27 27 128 1 0 0 159 270 1 1. 170 170 170 221 221 221 120 120 120 225 225 225 0 0 0 0 0 0;
#P comment 319 57 38 196617 sustain;
#P user dial 273 70 27 27 128 5 0 0 159 270 1 1. 170 170 170 221 221 221 120 120 120 225 225 225 0 0 0 0 0 0;
#P comment 273 57 31 196617 decay;
#P user dial 226 70 27 27 128 5 0 0 159 270 1 1. 170 170 170 221 221 221 120 120 120 225 225 225 0 0 0 0 0 0;
#P comment 224 57 33 196617 attack;
#P newex 131 119 86 196617 prepend midinote;
#P newex 131 93 48 196617 pack 0 0;
#P newex 131 59 40 196617 notein;
#P message 73 94 41 196617 steal 1;
#P message 25 181 47 196617 target 0;
#P newex 73 216 136 196617 poly~ synth 16;
#P fasten 15 1 1 0 248 163 30 163;
#P fasten 16 1 1 0 295 163 30 163;
#P fasten 17 1 1 0 345 163 30 163;
#P fasten 18 1 1 0 397 163 30 163;
#P connect 19 0 2 0;
#P fasten 1 0 0 0 30 211 78 211;
#P fasten 5 0 0 0 136 150 78 150;
#P connect 2 0 0 0;
#P fasten 15 0 0 1 231 175 109 175;
#P connect 3 0 4 0;
#P connect 4 0 5 0;
#P fasten 16 0 0 2 278 175 140 175;
#P fasten 14 0 0 3 328 185 171 185;
#P fasten 3 1 4 1 151 83 174 83;
#P fasten 18 0 0 4 380 175 202 175;
#P fasten 19 0 7 0 78 54 231 54;
#P connect 7 0 15 0;
#P fasten 19 0 9 0 78 54 278 54;
#P connect 9 0 16 0;
#P fasten 19 0 11 0 78 54 328 54;
#P connect 11 0 17 0;
#P connect 17 0 14 0;
#P fasten 19 0 13 0 78 54 380 54;
#P connect 13 0 18 0;
#P pop;

max v2;
#N vpatcher 881 77 1481 477;
#P origin 0 11;
#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#N out~ 1;
#P newobj 193 347 39 196617 out~ 1;
#P newex 193 322 27 196617 *~;
#N in 5;
#P newobj 190 191 25 196617 in 5;
#N in 4;
#P newobj 153 191 25 196617 in 4;
#N in 3;
#P newobj 116 191 25 196617 in 3;
#N in 2;
#P newobj 79 191 25 196617 in 2;
#P newex 42 157 40 196617 / 127.;
#P newex 42 114 33 196617 swap;
#P newex 42 70 40 196617 unpack;
#P newex 106 282 52 196617 thispoly~;
#N in 1;
#P newobj 42 40 25 196617 in 1;
#P newex 42 236 158 196617 adsr~;
#P connect 1 0 3 0;
#P connect 3 0 4 0;
#P connect 4 0 5 0;
#P connect 5 0 0 0;
#P fasten 3 1 4 1 77 100 70 100;
#P connect 6 0 0 1;
#P fasten 0 0 2 0 47 266 111 266;
#P fasten 0 2 2 0 145 267 111 267;
#P connect 7 0 0 2;
#P connect 8 0 0 3;
#P connect 9 0 0 4;
#P fasten 0 0 10 0 47 309 198 309;
#P connect 10 0 11 0;
#P pop;



jml
April 16, 2007 | 3:39 pm

Hi Steven,

Using midinote messages is *essential* here, because you are telling poly~ that it should expect a given note-off for each note-on you give it, i.e., the durations are not determined.

There are a couple things missing from your patch;

1. an oscillator! ;)
Maybe this was intentional for your demo, but I’ve modified it and everything seems to work fine.
2. You need to be turning your MIDI vals into Hz vals; you can use [mtof] for this.
3. If you allow the pitch to be instantaneously changed before you create a note-off for adsr~, then you’ll potentially hear clicks because the frequency is jumping to that value; this is something the "new envelope trigger" can be helpful for.

See patch:

#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P newex 173 224 33 9109513 edge~;
#P newex 25 276 27 9109513 f;
#P newex 42 223 28 9109513 mtof;
#P newex 25 297 54 9109513 cycle~ 440;
#N out~ 1;
#P newobj 25 344 39 9109513 out~ 1;
#P newex 25 319 109 9109513 *~;
#N in 5;
#P newobj 271 37 25 9109513 in 5;
#N in 4;
#P newobj 234 37 25 9109513 in 4;
#N in 3;
#P newobj 197 37 25 9109513 in 3;
#N in 2;
#P newobj 160 37 25 9109513 in 2;
#P newex 123 159 40 9109513 / 127.;
#P newex 34 111 54 9109513 swap;
#P newex 34 67 54 9109513 unpack 0 0;
#P newex 221 309 52 9109513 thispoly~;
#N in 1;
#P newobj 34 37 25 9109513 in 1;
#P newex 123 190 158 9109513 adsr~;
#P connect 0 0 10 1;
#P connect 0 0 2 0;
#P connect 9 0 0 4;
#P connect 8 0 0 3;
#P connect 0 2 2 0;
#P connect 7 0 0 2;
#P connect 0 1 15 0;
#P connect 6 0 0 1;
#P connect 5 0 0 0;
#P connect 4 0 5 0;
#P connect 3 1 4 1;
#P connect 10 0 11 0;
#P connect 12 0 10 0;
#P connect 3 0 4 0;
#P connect 1 0 3 0;
#P connect 4 1 13 0;
#P connect 13 0 14 1;
#P connect 15 0 14 0;
#P connect 14 0 12 0;
#P window clipboard copycount 16;

jl


April 17, 2007 | 10:10 am

Thanks for sending that patch. Actually the one i posted was a cut down version of my full patch. I already have my sound sources in place. I’ve been working on this project for a while now and i’ve always had this problem with stuck notes and missed notes. It happens about once in every ten notes i play from my keyboard.
When you talk about midinote messages do you mean notes from my keyboard or the word midinote sent into the right inlet of poly~? You said it is essential in my patch so i’ve looked into this but I don’t understand how it is supposed to work. It takes a two number arguments, one for pitch and one for velocity and sends them to the first instance. I’m sending lots of different note and velocity values to poly~ using my midi keyboard. Maybe i’m just being a bit thick here but if you could post an example of this it would be a great help
Thanks very much,
Steve



jml
April 17, 2007 | 7:09 pm

"midinote" is an identifier for [poly~]. Any note information, including pitch, vel, etc. needs to be prepended/formatted as such, and get delivered to the the left (main) inlet, not the right:

#P window setfont Geneva 9.;
#P window linecount 1;
#P newex 22 67 38 13172745 pack i i;
#P newex 22 43 40 13172745 notein;
#P newex 22 97 82 13172745 prepend midinote;
#P newex 22 148 98 13172745 poly~ poly_loadme 4;
#P connect 3 0 1 0;
#P connect 2 1 3 1;
#P connect 2 0 3 0;
#P connect 1 0 0 0;
#P window clipboard copycount 4;

jl


May 22, 2007 | 12:36 pm


May 22, 2007 | 3:03 pm


May 22, 2007 | 9:56 pm


May 23, 2007 | 5:48 pm


May 24, 2007 | 12:53 pm


May 25, 2007 | 8:16 am


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