Skip a numbers every b count

In my last question I mentioned a would have to transpose some notes with this command

// Transpose
// Only handle if within limits
if rr<0 then exit rules, skip Outgoing Action
if rr>7 then exit rules, skip Outgoing Action

Now instead of exiting rules if rr > 7 I would need to "skip 4 notes every 12 notes". Or in other words having "groups of 8 notes, then skipping 4", and continuing at note 9 where in the natural sequence it would be the 13th note. Writing the sequence off it would be:

natural: (00, 01, 02, 03, 04, 05, 06, 07, 08, 09, 10, 11, 12, 13, 14, 15, 16...)

modified: (00, 01, 02, 03, 04, 05, 06, 07, 12, 13, 14, 15, 16, 17, 18, 19, 24...)

I guess it's trivial logic but I really can't think of anything. It would be some sort of loop.

In words it would be assign value pp-96 and skip 4 numbers every 12 counts.

Any idea?

I'm not entirely sure what you are meaning, could you please confirm or clarify.

I assume you are sending notes one by one and for their first 8 you want to transpose by the incoming note number by -96.

On the 9th incoming note, you want to skip 4 notes so transpose by -92 (making the outgoing note 4 higher)

On 17th incoming note, you want to skip an additional 4 notes so transpose by -88 (making yet again 4 notes higher). 

One question I have is when you want to start the normal transposition again (back to -96)?


Or are instead, you don't care about the sequence of notes coming in but want to always translate the same incoming notes to a different position based on the incoming note number?


Steve Caldwell
Bome Q and A Moderator and
Independent Bome Consultant/Specialist

I’m pretty sure it’s the first case. The first block of 8 incoming notes are transposed by -96, then skip notes 9 to 12. Then the secondo block of 8 incoming notes are transposed by -92, then skip notes 21 to 24, then the third block etc.
Depending on which segment of the sequence I am I want the same result inside that segment. It’s not a matter of scaling the result on every incoming value proportionally to be extra clear.

Well I’m not sure. These notes are used to control buttons on my controller so I’m not sending them one-by one, I use them when I need them. Ehm. I’m not sure I understand your question lol

Well I hope I understand.

This one will count notes coming in. First 8 notes transposed -96. Then skip 4 then transpose with 4 more up the next 8 notes and so on.

I use the global variable gb for the current outgoing note.

I use the global variable ga to determine sequence 1-12


I use my computer ESC key to reset the counters.


Steve Caldwell
Bome Q and A Moderator and
Independent Bome Consultant/Specialist





Wait, is this counting notes played? I’m sorry but I explained myself extremely wrong.
When we talk about the first, the 9th or 17th notes I intend “on the scale”, not notes played in sequence… I want to map the first 8 notes of the scale (0-7), then skip the 4 successive notes (8-11) and so on.
These notes trigger buttons on my controller so it’s not that I have to play them in any particular order.

I may try to picture this differently. On one side there’s the midi messages sent out by 4 groups of 8 buttons on my controller (total is 32 buttons and it’s not important their layout). On the other side in my software I have another grid. But it’s not matching: it’s made of 4 groups of 12 pads. So what I want to achieve is only map the first 8 pads for every group on the software side of things so the software can mimic the hardware.
So then you can see that I have to skip 4 notes of the scale after the first 8, and up on the scale.
Hopefully it’s a bit clearer now? If it is not please ask what you need to know.
And thanks for replying on Sunday, that’s awesome in any case!

OK, that is entirely different. Look at preset 1.





Thank you! I’m testing it today.

It works like a charme!
I didn’t notice that the Divide operator does truncate any decimals by default. That makes a ton of sense. Is it thanks to that that an incoming note 7 will still output a value of zero, right? Clever (or at least it seems so to a noob like me xD)
Just a little question: I noticed that you checked Swallow MIDI message on both tranlsators. Can you explain why you did it and generally when it is advisable to do it?

Yes divide truncates simply because all MT Pro variables are signed integers. Swallow is the default and advised in most cases. Anything not swallowed will also go through the default thru paths defined untouched. Usually if you want to translate something, you don’t want the original incoming message going out.

Thank you Steve

You are welcome. Most issues like this is really more of a math exercise. Hopefully this example will make you a bit more self sufficient. Anyway that is my goal with help on this board.

I hope so, and that is also my goal. Yeah math is a big part. But also learning the correct syntax and stuff like how the program handle numbers (like knowing that variables are signed integers). My background is not scientific so sometimes it’s hard, and usually very time-consuming. But I hope that one step at a time I’ll learn.