Throttling of data and reversing of controls?

Hi All,
I’ve had my Electra one MKII for a while but am just now getting started making presets for it. There is no publicly available TX81z preset so I decided to try my hand at it.

The reason I’d shied away before is because I have neither the time nor inclination to learn Lua. Happy surprise it’s no longer necessary for Sysex presets! It’s working ok as a basic knobby controller so far but there a couple problems with it that I’m wondering might be solved:

  1. TX81z chokes when moving controls too quickly, is it possible to slow the rate that Electra one sends SYSX data?

  2. Rate controls for the envelopes are reversed, (0 is slowest) Is there and easy way to invert controls, I was hoping the Min/Max fields could be used for this but sadly no.

Many thanks,
Patchen

Can you use CC instead of sysex?

there is an existing preset for the tx81z, just not available through search…

https://app.electra.one/preset/L5pXMgmYJcqWxvkAK1kH

1 Like

No, Most old gear cannot.

Thanks for linking to this, Sadly it doesn’t solve the problems with the envelopes. I’ve got mine working fairly well and it suits my workflow fairly well. I don’t like the envelope sub-page feature of the Electra one and prefer to have my envelopes front and center. Only real issue now is the data rate problem but as I understand it a fix for this is in the works.

Cheers!

I’ve needed a reverse type control for other presets and ended up doing it through LUA.

I think Martin had talked one time about letting you set reverse ranges in the web UI, but as far as I know, it hasn’t made it to a release yet.

It’s trickier than it first appears. I can dig out the code if you think it would help.

Thank you and I appreciate that, however it’s not too big of a deal I think. I may dive into lua at some point but not sure it’s worth it to me yet.

The data throttling issue however is a pretty big deal. Looking forward to that change to the firmware.

No problem. I thought there was a setting in the instrument definition that helped throttle the rate.
Click on the little slider section in the upper left of the web UI editor (near the microphone) and there’s something in there about rate
(at least I thought there is - not able to bring stuff up here during the day to check).

I do know that I had to be careful about the volume of data when I was doing an editor for the TX-802 using the Lemur development environment and even now for things like effects units when you have to change/load a preset before you can edit it, you have to make sure enough time has elapsed between the “program change” and “edit params” commands.

Hi there, if you wouldn’t mind finding the LUA, that would be very helpful, I’ve just hit a similar situation in a modern synth: all the ADSR controls are reversed so the envelopes don’t function properly, and I figured this would by a matter of just setting 127 min and 0 max, but it doesn’t work, so any help would be amazing,

Many thanks,

I’ll try to get an example posted up tomorrow for you if Martin doesn’t beat me to it. lol

1 Like

Many thanks! This patch is for the Kasser DAFM.

It’s complete and functional, I just need to flip the envelope controls and the level controls and I can publish it.

Take a look at this small example
yamaha reverse

Some notes - the controls are defined a PT_VIRTUAL and they call a formatter to display the numbers in reverse order and they call a function to actually send out the CC messages. Note that parameter number of the encoder is used as the CC number. If you want to make the displayed value different/prettier, just modify the formatter functions (fmtLevel(), fmtAD().

Let me know if this works for your needs (I tried to use the CC numbers form the documentation).

1 Like

Thanks so much, that’s very kind of you,

I’m on my phone now but will have a look tomorrow or Wednesday at the studio, I’ve no Lun experience but have done some coding things (Unreal blueprint, a bit of HLSL, various DSP bits) so I shall have a go at reverse engineering and using the documentation and let you know how it goes!

I am trying to keep my examples simple and extensible with minimal programming knowledge required, but if something isn’t clear, let me know.

To your credit - you gave me a lot of specifics - machine name, area of the problem, and what you needed, so that helped speed the process.

1 Like

Many thanks! This kind of example makes learning the script much easier, I’d not have got far without your help! I deleted my post above with a bunch errors and remade it here.

This one works perfectly for the level:

function sendRevLevel(valueObject,value)
   ccNum = valueObject:getMessage():getParameterNumber()
   midi.sendControlChange(portNum,midiChannel,ccNum,127-value)
end

I switched out this format function’s numbers:

function fmtLevel(valueObject,value)
   return(math.floor(127-value))
end

For this:

function fmtLevel(valueObject,value)
   return(math.floor(value))
end

So it now just displays a simple 0-127 for OP Level instead of running from 127 to 0 on the display.

I’m using the ADSR display style, so didn’t use the ADSR formatting, but also I actually needed a slightly different function in the end.

The DAFM is a weird device and is converting full MIDI range to the number of values the Megadrive/Genesis could use for audio. So despite it saying value range is 32 for example, this is still sent as as 0-127. In order to achieve this stepping the function the 127-value was altered to 127-(value*4)-1

function sendADLevel(valueObject,value)
   ccNum = valueObject:getMessage():getParameterNumber()
   midi.sendControlChange(portNum,midiChannel,ccNum,127-(value*4)-1)
end

Where the value min max was set for the control as 1 - 32

the control value range must be 1-32. This is multipled by four, in order to get every fourth value from 1 to 128. One is subtracted after we’ve done our multiplcation, to put us back in the 0-127 range, allowing us to step through every fourth relevant MIDI value up and down in the 0-127 range. This is then subtracted from 127 to obtain the reversed value.

for the controls with a range of 16, it’s set 1-16in the min and max and the multiplier is 8:

function sendSRLevel(valueObject,value)
   ccNum = valueObject:getMessage():getParameterNumber()
   midi.sendControlChange(portNum,midiChannel,ccNum,127-(value*8)-1)
end

The only downside here is the E1 display doesn’t show sustain quite as zero when it is, and so on, as it thinks it’s 1, so I added a formatter:

function fmtAD(valueObject,value)
   return(math.floor(value-1))
end

I’m new to all this so it could be it can be done in a more efficient manner, so of course all criticism and tips are welcome.

I figured it’s worth pasting this in here so future visitors to this thread can see a practical example of reversed values in raw code :grin:

that’s excellent. I’m glad it was straightforward enough for you to understand what I tried to do and then adapt it to exactly what you needed.
Having the gear in front of you and wired in is a huge help. That’s why the more specific people can get with their questions, the more likely the answer will be in the ballpark.

BTW - I have a lot of formatter() functions that return value-1 or value+1. Even common things like MIDI channel. Yes, you can show the user 0-15 because “everyone knows” it is 1-16, but it’s still nicer to show it as 1-16 even though you send/store 0-15.

Thanks again, it’s so useful being able to deconstruct scripts like this.