Hello, I’m fairly new to coding and looking for some help with a simple Lua script.
This is for a Sysex based E-Mu Vintage Keys preset which I plan to share once complete.
The voice samples in the E-Mu are listed in the menu as numbers 0 - 434, but in Sysex, the values are 0 for no sample, and then 1537 - 1970 for the voice samples (an addition of 1536).
So I’d like to keep the original numbers in the list for referencing the hardware and add 1536 to most of the values, something along the lines of:
if < 1, use value 0
if > 0, add 1536
I think I can just add a Lua function within the Sysex string to increase the value, but I’m unsure how to code the function.
Also, as there are over 400 samples to label and assign values to, I wonder if there’s any way to upload a CSV type list or create a list in script as it might be quicker to format in this way?
Many thanks!
Jamie
FYI, below is the Sysex string for changing the voice sample.
And attached I’ve added a screenshot of the list (with the first few items changed to the correct Sysex value).
[
“F0”,
“18”,
“0A”,
“00”,
“03”,
“29”,
“00”,
{
“type”: “value”,
“rules”: [
{
“type”: “sysex”,
“parameterNumber”: 13,
“parameterBitPosition”: 0,
“byteBitPosition”: 0,
“bitWidth”: 7
}
]
},
{
“type”: “value”,
“rules”: [
{
“type”: “sysex”,
“parameterNumber”: 13,
“parameterBitPosition”: 7,
“byteBitPosition”: 0,
“bitWidth”: 5
}
]
},
“f7”
]