Making a random DnB Bassline

Léo BUFFET's icon

Hi everyone, for my school, we have to make a project only using midi on Logic. We obviously can use Max/MSP.
A friend is making a DnB beat while i'm trying to make a patch who will make a random bassline following a specified musical scale. My patch is already doing random note following that scale. However, i don't know how to make my patch write the first 3 notes with lenght (that i randomly generate too making these notes during 4 steps), and make a loop of that bassline. (these 3 notes)

There is my patch in attachment. In the left, i tried to make a counter with a "if" but i don't know how to start this. In the middle and the right, this is the random note and random lenght. (the urn is in the "p random" patch)

Any help?

Sorry for my bad english i'm french.

Random-bas.maxpat
Max Patch
Mike S's icon

If you alt+click makenote you can see that it accepts note durations. Also check out the transport help file. You might want to store the notes in a coll, or just use counter...

Léo BUFFET's icon

Ok well thank you, but i don't get how to store number in a coll and then output them in a message.
How can i do that?

Mike S's icon
Max Patch
Copy patch and select New From Clipboard in Max.
Léo BUFFET's icon

Thanks for your help, unfortunatelly, i started it over.

Max Patch
Copy patch and select New From Clipboard in Max.

Now i got this:

It will generate 2 multisliders, one for the note lenght (to the left), and one who select notes in a scale (to the right). Every 16 steps (96000ms in my 80BPM music) it generate two more multisliders to change the bassline. The problem is: When i push the "Start" toggle or when it generate the new multislider of lenght, the first note played is considering the old lenght multislider (you can see it to the order of the print message)
How can i solve this bug?

Thanks! :)

edit: Oh! I almost forget, how can i have the "Start" toggle pushed when i pushed "Play" in logicpro?

Augustine Bannatyne - Leudar's icon