Add Integer to Raw Midi Hexadecimal Channel

  • Q&A Forum
  • Add Integer to Raw Midi Hexadecimal Channel
0
0

If I set a local variable to capture and then increment the incoming midi channel on a Note ON/OFF event, can I do so by simply adding an integer to the raw midi message? i.e. if ga==1 then pp=pp+8

 

 

Marked as spam
Posted by (Q&A Forum: 2, Answers: 7)
December 12, 2018 5:31 pm
115 views
0
Private answer

Hi,

Please see the below diagram for how to handled APC20 LED Feedback if your application does not provide the feedback that you wish.

Basically, you define all inputs and outputs at the project level. This will be all inputs and outputs that you will use.

Then you set up 2 presets to override the project defaults.

The first preset you define output for your application (in this example a lighting application). When you define different inputs and outputs at the preset level, it will override the inputs and outputs at the project level.

Then you add a preset for your APC20 feedback and override the project defaults there as shown,

Under each preset you put the translators and what you want them to do for the target output.

Typically, some of the pads you want to toggle and others you do not going back to the APC20 on its preset and many lighting applications just trigger on notes-on messages.

The APC20 has 4 different operating modes and starts in Mode 0. In this mode several buttons are toggle already and you cannot otherwise manipulate them with the host (or MT Pro).  For my APC40-MK2 I usually go to Mode2 which allows me to completely control the LED’s with MT Pro. With this I set up an initialization sequence (Sysex Message) at startup to my controller to put it in the Mode I want.

Here is what I recommend for Mode 1 for output Sysex to APC20. The below numbers are all in hexadecimal.

F0 47 7F 7B 60 00 04 41 08 02 01 F7

Use a different number than 41 if you want to switch to a different mode.

Modes :

0x40 – Generic (Startup Default) Track select Radio- Channel Toggle

0x41 – Ableton Live (LED Ring Remote Controlled) Momentary All

0x42 – Alternate Ableton Live Momentary All

0x43 – Note Mode (APC 20 only)

Steve Caldwell
Bome Q and A Moderator and
Independent Bome Consultant/Specialist
bome@sniz.biz

 

Attachments:
Marked as spam
Posted by (Q&A Forum: 39, Answers: 3280)
December 13, 2018 5:26 pm
0
Private answer

Hi,
So if you want to make buttons toggle you do this (the simple way with one global variable per button). In this example I do not transpose any channels.

——
Translator : Button 0
Incoming: Note-on MIDI Channel 1 note 0 any velocity

// Toggle ga

ga=ga^1
pp=0
// maximum velocity. on APC20 you can use different velocities to send back different

// colors to the controller.
if ga==1 then pp=127

This will toggle ga to 1 or 0  with the exclusive OR bitwise operator. But you can then use the velocity to determine the color you return back to your APC20.

You would need a different global variable for each button.

There is a way to use a single global variable (which is 32 bits) to control 32 different LED’s but it is beyond the scope of this discussion. You should be able to find my post on “bitmapping” by searching this forum. If I remember I put an example out there that toggled all 64 of the main APC-MINI LED’s with just 2  32 bit global variables. You shouldn’t have to worry about the number of global variables available except for very large projects.

There are 360 global variables available for use.

See section 10.3.2 of the user manual for their naming conventions. You can press F1 inside of Bome MIDI Translator Pro to pull up the user manual.

Steve Caldwell
Bome Q and A Moderator and
Independent Bome Consultant/Specialist
bome@sniz.biz

 

The LED mappings are basically this:

0-off
1-on green
2-flashing green
3-red
4-f red
5-orange
6-f orange
https://www.native-instruments.com/forum/threads/akai-apc20-midi-mapping-for-effects-with-leds.134449/

 

Marked as spam
Posted by (Q&A Forum: 39, Answers: 3280)
December 13, 2018 4:43 am

To return back the velocity to the APC20, do I need to select it as MIDI OUT in addition to having the Bome Virtual Out selected? (This is NOT referring to the routing but the Outgoing section –> Select MIDI ports). Also, I’m assuming I will need translators for each button as well then?

( at December 13, 2018 3:10 pm)
0
Private answer

Thanks, Steve. It sounds like a local variable is what I need then. Basically, I want to create a “shifter” when a particular button is pressed on my midi device, however, I need it to be dynamic. Could you take a look at the project I’ve attached to see if I set this up properly? Details:

Global variable ga is initially set to 0 and will change when the note ON/OFF event occurs for channel 8, note 48. Local variables are then stored on any note ON/OFF event and incremented ONLY IF ga=1. I also would need the original/default device midi message to pass thru if ga=0; would this need an additional translator? (Ignore the “Fader Translator” in the project)

Attachments:
Marked as spam
Posted by (Q&A Forum: 2, Answers: 7)
December 12, 2018 6:11 pm

I think I actually already allow the default midi message to pass thru anyway.

( at December 12, 2018 6:23 pm)

Hi, it looks like you have it right. You probably need:

1) A note-off translator for the shift function
2) You probably don’t need this statement since pp is already set to the default incoming
channel

if ga==0 then pp=pp

3) You should probably create something to turn off any existing playing notes when you release note 8 (shift function). Otherwise, the playing note will get stuck on because when you release the shift and then the note, the note-off will pass through on the incoming channel.

For number 3, I usually would send either an all-notes-off CC message (if your controller supports it), or use a timer to iterate through all notes on the shifted channel turning them all off just in case one was playing when you released shift. (which is another discussion I can help you with if you would like).

Steve Caldwell
Bome Q and A Moderator and
Independent Bome Consultant/Specialist
bome@sniz.biz

( at December 12, 2018 6:25 pm)

Default message passes through only if you have a MIDI thru path defined in MIDI routing section or you have another translator handling it.

Important to note that if you have a translator that does not execute because of a

exit rules, skip outgoing action

The default thru path will still pass through the incoming action.

Steve Caldwell
Bome Q and A Moderator and
Independent Bome Consultant/Specialist
bome@sniz.biz

( at December 12, 2018 6:28 pm)

Very cool, thank you so much. I will give it a shot and get back to you!

( at December 12, 2018 6:29 pm)

Steve, it seems when I change the note ON channel and construct my outgoing raw midi message, it is actually changing the message type to a control change when it reaches the application I am using to read it. Have you seen this problem before?

( at December 12, 2018 8:38 pm)

Ah, you are using Raw MIDI output instead of note so you will need to assemble your control byte. The upper nibble is the command 0x90 for note-on. The lower half is the channel 0x0n for channel where channel is n.

So for note on on channel number plus 1 you would need to do something like this after pp=pp+1

pp=0x90|pp

Which is an bitwise OR function.

So if your note was coming in on MIDI Channel 2, pp would start out as 1, you would a 1 to that (which would be channel 3)

Then you or it with note-on and you get 0x92

Make sense?

( at December 12, 2018 8:49 pm)
So what I did was change the outgoing message to a Note On and passed the necessary values from the local variables, which I should have done in the first place. What is frustrating me currently is that the APC20’s clip launch buttons are momentary, sending both note on and then note off messages when button is released. I managed to only pass thru the note on messages and swallow the note off ones. Is this even good practice? The reason I did this in the first place was to attempt keeping the LED lit. So I take it I will need a whole different set up to try getting these buttons to behave as non-momentary. :////
( at December 13, 2018 3:27 am)
1
Private answer

Yes but the local variable will not remember its last value on the next iteration of firing.

So if you are transmitting note on MIDI CH1 and you want it on MIDI CH2 you could

Incoming Note on Any Channel set channel to oo Any Note set note to pp Any value set value to qq

Rules

pp=pp+1

Outgoing Note On Channel oo Note pp Value qq


In the above any note coming on MIDI CH1 will go out on MIDI CH2. If it came in on MIDI CH2 it would go out on MIDI CH3 etc.  Be careful not to send on MIDI CH 16. I suppose since the outgoing is a 7 bit value it would go out out on MIDI CH1 but I’m not sure.

Also notice that if you pp is MIDI CH1 the value of pp is 0 since MIDI Channels start with 0.

Now if you want to increment the MIDI CH each time, then it gets more complex and would involve a global variable.  Let me know if that is what you want to do and I can give you an example there.

Steve Caldwell
Bome Q and A Moderator and
Independent Bome Consultant/Specialist
bome@sniz.biz

 

Marked as spam
Posted by (Q&A Forum: 39, Answers: 3280)
December 12, 2018 5:58 pm