I’m having trouble setting up controls for a Yamaha FB-01. It uses particular bits within two nibbles to control multiple parameters in one message. The Algorithm select (Parameter 4C) uses 3 bits from the MSB, with the LSB bits first. I can change the algorithm successfully, but how do I do so without changing the other parameters within the bytes?
the trick here is to have rules that will compose given sysex byte (4C) using multiple parameter values. It sounds cryptic I know
an example:
Make following controls:
“Left Output Enable” and mark it as parameter 1000, type sysex
“Right Output Enable” as a parameter 1001, type sysex
“Feedback” as a parameter 1002, type sysex
“Algorithm” as a parameter 1003, type sysex
When you change any of these, you need to make sure that current values of all of them are used to compose the outgoing sysex message and the bits are placed at correct position within the sysex value byte.
In the two nibbles tutorial, you work with one parameter and you need to split it into two bytes. That is why the parameterBitPosition is used. In your case, the parameters end up in single sysex byte, therefore you just work with bitWidth and position of the parameter within the sysex byte byteBitPosition. Hope it helps.
I tried out your example, but it didn’t work unfortunately. I must be missing something, because from what I can understand from the manual the voice parameters do use 2 bytes.
Ok, I see. Sorry, I missed the part about that the parameter values must be sent as two nibbles. Then I would try following:
providing the system No and the instrument No are 0.
The first value byte consists of all 3 bits of parameter 1003 and 1 bit of 1002. The second value byte has remaining 2 bits of 1002 (hence the parameterBitPosition is needed) and 1 bit for 1001 and 1000.
Ok, we’re getting somewhere! With that example the algorithm select is now working again, and isn’t being changed by the other controls, but those other controls don’t seem to be doing anything. This FB-01 sysex implementation…
I’ll try out some other voice parameters with this example and see if I have better luck.
:UPDATE:
So I’ve done a number of the other parameter changes that use 2 bytes, like the operator enable/disable, and everything is working as is should. The only issue I’m having is the “Feedback” where the 3 bits are split between the bytes. I’m really at a loss as to why this isn’t working.
I figured out the issue once I got more parameters set up. The operators in the algorithm diagrams were reversed, so OP4 was actually OP1. The manual lists this incorrectly.
@martin the last example you gave me worked once I fixed that. Thanks for the help! I might be able to figure out my Casio CZ-1 after all of this.
function mainWorker(ValueObject, Value)
local message = ValueObject:getMessage()
local control = ValueObject:getControl()
local currentParameterNumber = message:getParameterNumber()
local curValue = message:getValue()
if ( currentParameterNumber ~= previousParameterNumber ) then
-- we store the current value as the previous for the next time
previousParameterNumber = currentParameterNumber
-- common way to separate the tens digit and the ones digit
local byte1st = math.floor(currentParameterNumber / 10)
local byte2nd = currentParameterNumber % 10
sysexMsg = { 15, 1, 1, parameterSelect, byte1st, byte2nd, valueSelect, endCommand }
midi.sendSysex(PORT_1, sysexMsg)
end