Overlapping notes, pitch

synnys's icon

Hi,

I'm making a CV out device in max to control my modular.

One of the problems i'm having is overlapping notes, i'd like to create those famous 303 slides.

The problem is (when you look at the attached image) that it outputs the following data string for the pitches:

72 (note C4 on) 84 (note C5 on) 84 (note C5 off) 84 (note C5 on) 84 (note C5 off) 72 (note C4 off)

The problem lies between the two C5 notes, I'd like to make the pitch go back to 72 since that is the only note left playing. But it doesn't (hear the attached audio file)

Anybody got an idea how i could code that?

I also had the problem with overlapping notes, that a note off message of the second note would also cut off the first playing note. I fixed that with a bit of java script, might be usefull to others as well. it's below:

var v=0;
var counter=0;

if (jsarguments.length>1)
    v = jsarguments[1];

function msg_int(v)
{

    if( v > 0 ) {
        counter++;
        outlet( 0, 1);
    } else {

        if ( counter > 0 ) {
            counter--;
            if( counter == 0 ) {
                outlet( 0, 0);
            }

        }
    }

Screen-Shot-2015-03-25-at-17.00.12.png
png
do.while's icon

Hi . so u are after mono note behaviour ? u have to track notes On/Off . It would be appropriate to store them in an array to flag active notes . Then check if there is an active note while noteOff is received for legato into to nearest active note . Let me know if thats enough .

btw . are u trying process midi data through JS ? there will be some timing issues :/

synnys's icon

yes that's exactly what i'm after, but i have no idea how. do you have an example?

I actually haven't noticed timing issues yet using js (although i just started testing)

do.while's icon
Max Patch
Copy patch and select New From Clipboard in Max.

hi ! try vanilla version :) let me know if u really need JS version .

Wetterberg's icon

You're essentially looking for ddg.mono I think.

synnys's icon

ddg.mono

wow, that is what i was looking for all along!

i could kiss you.

Thanks!

synnys's icon

and do while, thank you as well, your patch also works great :)