Forums > Max For Live

Binary string to midi

August 21, 2013 | 8:40 pm

Hey, I’m completely new to max, just started messing with it today, and I was wondering if any of you knew a way that I could take a binary string and convert it to midi on/off messages. For example, if I had a binary string 01001100, how would I make max output a note on beat 2, 5 and 6 of an 8th not resolution grid? Thanks!

August 22, 2013 | 10:27 am

Since you say you’re new to Max and just started messing with it today, I’ll give you the advice everyone gives: study all the tutorials you can stand.

There’s a number of ways one might do what you describe. Here’s about the simplest way to do it.

– Pasted Max Patch, click to expand. –

August 22, 2013 | 11:21 pm

Azrael, it’s important to distinguish between a generic string and a list (a type of string). You will quickly find that lists are the way to go when it comes to processing bits in Max. Simply put.. there is a world of difference between 01001100 and 0 1 0 0 1 1 0 0. Most objects are set up to process the latter. If for some reason you must use the former, you will need to convert the string into a single symbol which generally affords you less flexibility when it comes to bit manipulation. Otherwise, for example, the string you posted would automatically become 1001100 when passing it along as a message.

Here is Chris’s patch with a simple way of inputting lists into the table. You can also edit the table directly, but it’s good to get familiar with toggles.

– Pasted Max Patch, click to expand. –

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