Loopy Pro: Create music, your way.
What is Loopy Pro? — Loopy Pro is a powerful, flexible, and intuitive live looper, sampler, clip launcher and DAW for iPhone and iPad. At its core, it allows you to record and layer sounds in real-time to create complex musical arrangements. But it doesn’t stop there—Loopy Pro offers advanced tools to customize your workflow, build dynamic performance setups, and create a seamless connection between instruments, effects, and external gear.
Use it for live looping, sequencing, arranging, mixing, and much more. Whether you're a live performer, a producer, or just experimenting with sound, Loopy Pro helps you take control of your creative process.
Download on the App StoreLoopy Pro is your all-in-one musical toolkit. Try it for free today.
Mozaic: How to send sysex numbers that are >255?
I just noticed that I can't send numbers >255 using sysex:
@OnLoad
data = [254, 255, 256, 257]
SendSysex data, 4
@End
@OnSysex
ReceiveSysex data
Log data[0]
Log data[1]
Log data[2]
Log data[3]
@End
Output:
254
255
0
1
It seems to "wrap around" and start at 0 when reaching 256.
Is this really the limit? Can't I send anything bigger than 256?
Thank you.
Comments
AFAIK that’s midi standard limit. No app or hardware could handle values above. I could be wrong...
Okay, thank you.
Midi for nw s 8bit since the 80s
Is there any way to work around this limit? AFAIK Sysex can transmit any kind of data somehow...?
@josh83 Parameters with higher resolution are usually split into multiple "packets".
Manufacturers are free to define whatever weirdness they desire.
There have been a few attempts to have some kind of common sense in the past decades but without much success.
Hm, using Mozaic, does anyone know a good solution/workaround/hack?
Yes, use sysex the way it's designed.
Pitch bend combines two bytes (MSB * LSB), for 16,384 values with max of 127 for each byte. Perhaps you could do the same with your sysex messages.
Hm sounds frightening. ;-) I will see whether I find another way to reach my goal.
Thanks anyway, guys!
It depends on the device that is receiving it. You need to find out what it’s protocols and proceed accordingly. Are you sure your device handles values over 255? Some MIDI, btw, isn’t 8-bit...and uses only 7-bits. There are some calculators to be found on the web to convert values over 127 into multiple 7-bit bytes.
Goal? What goal? 🤔
I'm desperately trying to create a rather complex script using Mozaic. ;-) Nevermind, I will find my way. One day I will have hit all the limitations of MIDI and Mozaic, and then I will know how to reach my goal...
Not sure if this is what you’re looking for but you can always decompose a large integer into a sequence of bytes and recombine them into the original integer... note: this only works for integers
Thanks, @xor. Does this work for any big integer number? E.g. would it work for 1234 and 12345678 in the same procedure? (Sorry, I'm too lazy to try to understand your code).
Yes - midi sysex sends out a given number of bytes, each is 8 bit. Therefore the value range of each data element is 0 to 255.
To send larger values, you need to split them into several bytes on the sender and recombine the values at the receiver. With two bytes you could send values from 0 to 65535:
There are other common conversions to byte for larger unsigned integer ranges, fixed point values or even floats.
And you need to know what the device supports. I have a Roland device and even in sysex streams it uses 7-bit bytes not 8-bit bytes. This is because the “end of sysex” message is an 8-bit value. So, if you could have 8-bit values in the sysex stream, you might end up having that value mid-stream. I could be wrong but I think most devices use 7-bit values for sysex bytes.
Sysex is weird because (as noted above) the “end of packet” message is an 8-bit byte.
I only know about this because I had to reverse engineer some sysex stuff where I needed to send values over 127 (in my case up to 999) and things didn’t work until a kind person pointed out to me that most devices use 7-bit bytes inside of sysex streams.
There is even a site (maybe a page on the MIDI Designer Pro site) that converts numbers into the correct sequence of 7-bit bytes.
There are many articles to be found about this on the web.
This discussion may be of interest:
https://forum.juce.com/t/sysex-messages-containing-bytes-greater-than-127/34792/3
There's no reason to assume we're talking about hardware here. @josh83 may be using Sysex in other ways, such as communication between different scripts. For that one could well need to send values over 255. The bottom line however is bytes will need to be combined to get those values.
if the receiver relies on the “end of sysex” value, it can’t contain that value in the stream. It would possible to ignore that if a receiver uses a byte count at the beginning of the sysex message and doesn’t terminate the stream when it sees the “end of sysex” byte.
As I said, you need to know that the device (or receiver) uses as its protocol. If you used Mozaic as receiver, for instance, your received sysex message would be truncated if it contained the “end of sysex” byte value.
In any case, as I said earlier, you need to know what the receiver expects.
@josh83 since each byte can hold a number up to (but not including) 256, 2 bytes can hold up to 256 * 256 or 65536. Three bytes can hold 256 * 256 * 256 or 16,777,216. So you have to figure out the largest number you want to support and choose the number of bytes accordingly. A general formula for N bytes is:
@tja: btw, if you read the document you linked to, you will see that pitch-bend uses two 7-bit bytes for its values. One for the high order part of the value one for the lower order part. The part of the article talking about 8-bit values is just an overview about bytes and the possible values a byte can have. It doesn’t mean that all MIDI values use 8-bit values.
(Btw, 7-bit bytes are 8 bits long. It is just that the first bit is ignored).
Btw, you can only do that if the receiver doesn’t treat 247 as the “end of sysex” marker. (You could also choose not to allow 247 as a value to get around this).
I think you misunderstood what I wrote. What programmers call “7-bit bytes” are normal 8-bit bytes except that the first bit is ignored. For most sysex applications, this is important because values over 127 need two “7-bit bytes”.
Also relevant. The 7-bit byte calculator I mentioned
https://mididesigner.com/help/midi-byte-calculator/
Sounds like you're trying to control a Lexicon MPX1, a.k.a. the sysex devil 😅
Hehe... loved the sound, tried to make a controller, gave up, loved to see it go...