I wonder if somebody managed to send a program change command with a simple keypad. May I overlooked something but I didn’t find something which is related to midibox.
I wish to type in a number and after pressing an “enter”-button it sends the program change number.
It doesn’t matter if buttons are directly connected to DINs, or buttons of a keypad matrix would be used - some special routines are required which are not part of the firmware yet.
I need some time to find a generic solution for this.
E.g. if the .NGR language would allow arithmetic operations, such as the modification of BCD-code digits of an element, then this would satisfy your request and could also be used for other purposes.
You can either use buttons connected to DIN shift registers, or you could use a real keypad connected to DIN/DOUT in a suitable DIN_MATRIX configuration (not shown in this example, but it shouldn’t be so difficult to configure this…)
Yes, you can now add similar commands for any other value, just store them into different LED:xxx numbers (the LED event actually acts as some kind of memory, resp. variables).
Then you could also use another LED:yyy to switch the keyboard between the different selection modes.
It will result into a lot of “spaghetti code” (.NGR is no elegant programming language, but just a dumb command interpreter), but you will be able to implement this with the given functions.
Great! I figured out how to send a CC which contains the bank select and after that the program change. It works great!
EXEC button
if ^section == 11
# valid number?
if LED:2001 == 1
send CC USB1 1 32 0 // the last value shows the bank which is selected by this CC - in this case 0
send ProgramChange USB1 1 LED:2000
# next entry will reset the number
set LED:2001 2
endif
So, what I could do is, adding two buttons. Those two buttons change between bank select 1 and 2. But I think this is a complicated solution. Here is an idea:
Is it possible, that NG generates the correct program change (including bank select) automatically? So, for example: I enter number 128 and NG sends Program Change 1 on Channel 1 on Bank 2 because it’s the first program change in the new bank.
What do you think?
A friend of mine uses Mainstage and he has a very large setup running, which contains up to 200 songs. Mainstage (meanwhile) supports bank select. So this would be a great feature.
First you have to change the value limitation to allow a value entry in the range of 0..255.
In the different sections you will find “if” conditions which check for certain numbers, e.g. in section 1..7 it’s checked that the value is <= 12
Why? because we want to ensure that it isn’t possible to enter a value > 127.
A program change ranges from 0..127, values above this range are invalid.
Example: If somebody would enter ‘1’, and then a ‘3’ (-> 13), an additional ‘1’ would result into 131 -> invalid value!
Therefore only <= 12 is allowed.
Now you’ve to change it in a way that value between 0..255 can be entered, and all other values are blocked.
To give you some hints: for ^section 1 it will be <= 25
Once you are able to enter values between 0..255, replace the MIDI event sending code by:
# EXEC button
if ^section == 11
# valid number?
if LED:2001 == 1
if LED:2000 < 128
# Bank 1
send CC USB1 1 32 0
# Program Change
send ProgramChange USB1 1 LED:2000
else
# Bank 2
send CC USB1 1 32 1
# Program Change
# modulo operation: ensure that PC value is in range between 0..127
send ProgramChange USB1 1 [LED:2000 % 128]
endif
# next entry will reset the number
set LED:2001 2
endif
exit
endif
This could also be simplified with:
# EXEC button
if ^section == 11
# valid number?
if LED:2001 == 1
# Bank = value / 128
send CC USB1 1 32 [LED:2000 / 128]
# Program Change
# modulo operation: ensure that PC value is in range between 0..127
send ProgramChange USB1 1 [LED:2000 % 128]
# next entry will reset the number
set LED:2001 2
endif
exit
endif
This code is untested - in case of errors, please first try to debug this by yourself!
The new features you added… could you do an example for what this could be useful?
E.g. let’s say somebody wants to construct an unusual NRPN value format for a certain synth, the nested operations will help you to do this.
Or somebody needs an IF condition depending on a certain bit of a value such as [^value & 0x40] == 0x40 -> now possible.
Of course, I will give more examples in the documentation sooner or later, but I guess that most users need a direct specification from my side to solve a configuration issue. My advantage: I don’t need to enhance the firmware anymore for such special cases.
SRIO: Serial Register Input/Output -> MBHP_DIN, MBHP_DOUT, MBHP_DRIO
You don’t need new hardware to test this…
Some time ago you complained that the scan latency of a keyboard is worse when using MBNG compared to MBKB.
By reducing the number of scanned shift registers you will get the same performance.