Beta v3.5 - Data pipe demo

This is the last bit for now.

This is a very early implementation of a feature that could make E1 a good platform for generating and processing MIDI data. Input and ideas are very welcomed.

Data pipe is a simple and fast queue that can be used to exchange data between active presets. Data means 32-bit float signed numbers. Similarly to MIDI, the data can be transferred on channels. There are 255 channels though.

Sending data:

A simple one functions that pushes the float number to given Data pipe channel:

pipe.send(channel, floatNumber)

an example of using sending data can be found in a Simple LFO preset.

Receiving data:

Receiving needs a little bit more coding. A callback function must be defined and registered to listen for incoming data on given Data pipe channel:

function preset.onLoad()
    local channel = 1
    pipe.subscribe(channel, printData)

function printData(channel, data)
    print("pipe data: " .. data)

An example of processing data received from the Data pipe: Receive LFO.

The preset Simple LFO and Receive LFO both use Data pipe channel #1. To test them follow the steps below:

  1. upload Simple LFO to preset slot 1
  2. upload Receive LFO to preset slot 2
  3. open the preset selection window and press and hold the Simple LFO preset button. Long press will load the preset and will pin it to keep it running.
  4. open the preset selection window and press and hold the Receive LFO preset button.
  5. now, both presets should be pinned to run in parallel. if you open the preset selection window again, both presets should have “listening” icons on their buttons.
  6. switch to Simple LFO, ajust the settings and hit RUN button. If everything works correctly, you should see log messages coming out of Receive LFO preset. And one of the MIDI parameters will be modulated by the LFO.

Again, it is very early phase of the idea. UI is a bit clumsy, timers sometimes hiccup. I will be working on making sure the timings are 100% reliable and stable.

An ultimate goal is to be able create presets that allow users to link controls in one preset (say Roland System 1m) to output of another preset (Simple LFO). That intermediary preset would control sources, destinations, depth, and possibly do any other MIDI processing.

Two presets pinned as active:


I’m not sure if the callbacks trigger a redraw inline for the presets or if they just flag elements as dirty to recompute for the next screen refresh as a synchronous call would break down with enough Lua updates to the UI and a Timer would be a denial of service.

Some stuff can probably be jettisoned if the preset is in the background as well, such as logic to check/invoke the callbacks for UI actions from the screen as they would never happen. Those invoked directly in Lua would still need to update the minimal state and mark the elements dirty though.

All events and Lua actions only mark visual components as dirty and separate lower priority worker runs paints at given timeframes. That is fine. The issue to tackle is that the low-level communication between CPU and GPU relies on a higher-priority interrupt. There are many ways to resolve that though.


Well I’m going to have to mull this over a bit.

I was going to try doing MIDI LFOs/Envelopes in the worker preset synced to the NoteOns from the Supervisor preset. The Supervisor would fire down trigger notifications to the worker any time something being watched happened.

But before I was about to do that I realized I could implement all those in my Hydrasynth currently as any of the 5 Envelopes and 5 LFOs can be routed to MIDI CCs. And they can be synced either to NoteOns or left free running so I could offload that sort of thing to that module.

So I’m going to see if I can think up some more exotic trigger mechanisms that would only be possible in the Electra One before I get down to coding :slight_smile:

the main purpose why I rolled data pipe out was to gather feedback from you guys. If you feel you would need any additions or changes, just let me know.

1 Like