Fun toy

Inspired by the arcane Grex MXF8, here’s a little toy app I call Mr Shifty.
Sample triggers

This is something that makes me laugh out loud sometimes when I’m triggering various samples in the Octatrack. Note that the default note number is set for the Octatrack, so you might want to adjust that up or down before pressing start.

I hope others find this fun as well. It actually seems a bit more stable on the mk I than the mk II.

Basic idea - set up a sampler or multi-timbral synth on channels 1-8.
The app sends note on/note off messages at regular intervals. I flash the shift offset area white briefly when I send a note on, and blue for note off so you can visually see what’s going on across the channels.

Global controls on the right for start/stop, size of the loop, speed, and a delta between the note on and note off.

Note that many settings can cause out of bounds conditions where a sound isn’t triggered or other weirdness results. It is kind of but not really working with MIDI BPM/tempo just yet.

Over time, I will do things like update related control min/max so you can’t go out of bounds if LoopZone is adjusted and get it to work with MIDI BPM internally and externally. If it locks up, you’ll likely have to reboot the Electra One and possibly your computer. Such is the power we have in this box. lol

Page 1 lets you set the start time offsets (not offset into the number of samples) the number of repeats inside the window, and a velocity amount.

Page 2 gives you control over note number and channel volume.

3 Likes

Hey Dude, It been a while. I am back in the game with a MKII
Cool stuff, I also checked the Grex MXF8.
Would be great if it sync’s to midi and you can implement scales.

1 Like

There’s no notion of scales. The original Grex Ratio Sequencer was designed to trigger sample loops or percussion and mess around with when and how often the triggers happened.
So each channel is really a sample trigger. The original target was Ableton or samples in Cubase.

It was never meant to be a sequencer/arpeggiator. The desire was to slide loops around against each other to get some interesting textures.
I’ve been trigger an Octatrack and also drum setups on an E-Mu MP-7

I do want to add MIDI clocking/BPM to it, but initially I was having a lot of problems with the timer, so I just left it as raw time.
Now that it’s more stable, I’ll look into the transport.XXX() calls and see if I can dynamically use internal clock or external.
The Electra wasn’t really set up to be a sequencer of any type, so even doing this has proven to be more challenging than anticipated.

Anyhow good to know the sequencer things are a bit out of scope.
It makes sense if someone really wants to go that route he could build a dedicated app for it.
Ah ok will try it out with my Pioneer SP16.

To the best of my knowledge, the current timer interrupt routine resolution is 10 ms.
So if you need to closely generate and track MIDI clocks (not BPMs) to get fine-grain resolution, at some BPMs you will be “in between” timer calls because the timer period is an integer.
Example: 60 BPM = 60 1/4 notes per minute. 24 MIDI clocks per 1/4 note = 1440 MIDI clocks per minute. Each minute has 60,000 ms which is 6,000 timer calls per minute.
So that means a MIDI clock happens every 4.166667 timer calls.

Even if you’re tracking BPM and don’t care about a finer resolution, 72 BPM = 72 1/4 notes which is a 1/4 note every 833.333 ms

You can get close to integer values, but the point is - the current Electra One OS is great for what it is designed for and can be great for things like LFOs or for stand-alone stuff, but it’s probably not the best tool for precise MIDI timing.

I have not played with the transport.start()/stop()/onClock() controls, so maybe syncing to an external MIDI clock will be tighter

There’s two timer mechanisms from what I’ve read in the docs, one is time based and the other is BPM based.

timer.setBpm ()

Set the BPM of running the timer ticks.

  • period - integer, period specified in BPM (1…6000).

timer.getBpm ()

Get the BPM of the timer ticks.

  • returns - integer, period specified in BPM.

That said if you want to synchronize an event oriented approach based on the midi clock is better.

I don’t think there’s any scale/chord/note math libraries atm. I was going to do some basic Snap to Key stuff at some point.

It’s mostly modular math but you’d need to have generating functions that store something like the semitone numbers relative to the key center for a bunch of scales.

Those would likely be better off not stored in memory but on disk in assets with some compacted sparse format that can be looked up (I think there was some mentioning of a SQLite DB).

So if you want C Major you look up the generating function for Major and set the midi note offset and call functions like.

scale.inKey(note, scalePosOffset, rounding_direction)

So:

note.inKey(45, SCALE_3RD, ROUND_UP)

Would take the note, round to the nearest higher scale position (current value) and then go up a 3rd from that.

Behind the scenes timer.setBpm() does a setperiod(60000/bpm) and setPeriod() take a uint32 so if you specify bpm=6000 you get a 10ms period.

I’m going to try the transport.XXX() stuff the next couple days to see what it is capable of doing. Oddly, I didn’t see a transport.showBpm() or anything to allow the Electra One to display the incoming BPM.

I’ve had to use a lot of static tables for the PCM 70 and 80 editors and on the Mk II there seems to be plenty of room for them. They blew through the Mk I limits though …

| adamc
September 18 |

  • | - |

There’s two timer mechanisms from what I’ve read in the docs, one is time based and the other is BPM based.

timer.setBpm ()

Set the BPM of running the timer ticks.

  • period - integer, period specified in BPM (1…6000).

timer.getBpm ()

Get the BPM of the timer ticks.

  • returns - integer, period specified in BPM.

That said if you want to synchronize an event oriented approach based on the midi clock is better.

Flyweight:

you can implement scales.

I don’t think there’s any scale/chord/note math libraries atm. I was going to do some basic Snap to Key stuff at some point.

It’s mostly modular math but you’d need to have generating functions that store something like the semitone numbers relative to the key center for a bunch of scales.

Those would likely be better off not stored in memory but on disk in assets with some compacted sparse format that can be looked up (I think there was some mentioning of a SQLite DB).

So if you want C Major you look up the generating function for Major and set the midi note offset and call functions like.

scale.inKey(note, scalePosOffset, rounding_direction)

So:

note.inKey(45, SCALE_3RD, ROUND_UP)

Would take the note, round to the nearest higher scale position (current value) and then go up a 3rd from that.

Mr Shifty made my programming and testing more fun today :slight_smile: I hooked it up to Nord Rack 2x and sequenced 4 patches. pretty awesome.

With transport module you will be able to sync it to incoming MIDI clock. And as the feature requests are flying around… it would be great to be able to transpose with a midi keyboard :wink:

1 Like

Since I’m going to be making some changes the new few days, I might as well ask a couple questions –

Of the folks that have used it, what do you feel is the best choice for that 3rd set of controls across the bottom of the first page - velocity, notes, or channel volume?
In addition to external MIDI sync and external keyboard control over note changes/transpose is there any other “hey it would be cool if …” things?
Current design of hardwired MIDI channels 1-8 ok?

No promises of course. This was meant to be a light-hearted diversion from my struggles to finish the PCM 70 and 80 editors.

added MIDI transpose and a couple other cleanups.

If you leave everything alone, the default behavior is to read the incoming MIDI channel and set the note on appropriately. MIDI channel 9 becomes a global channel that sets all notes to that value.

If, on Page 2, you turn on the “Note+Velo” button, the velocity sent with the note will be used for that channel (or for all if sent on channel 9)

If you want to play with the range of MIDI channels, there’s a control on Page 2. Barely tested, seems to be generally OK.

Still not happy with the Note duration display. Logically it should start mostly full and decrease the bar as well as the value, but going backwards is always a challenge and I had other things to work on at the moment. Someday I’ll clean that up.

OK - external sync is there. Simple use: Press the Int/Ext button then start sending clocks to the Electra One. No need to press the Start/Stop button.

Right now, by default, the transport.enable() call is not made ahead of time. I do not know what would happen if you had transport listening and internal running as well. So best to not mess with it now.

Currently, nothing on screen is re-labeled/re-scaled to show BPMs.
Not sure if there’s any functionality for me to determine the current incoming BPM.

Yet another edit – external sync and quickly turning things that generate MIDI (like Note number or velocity) can cause a lock up (at least on the mk I units).

1 Like

I can see the 3rd row is occupied already :slight_smile: What I would like to have there (just a suggestion) would be a user defined CC.

There’s room on Page 2 to move the velocity controls there. There’s another 10 pages available as well. lol

My only comment is that it was never meant to be a full-fledged sequencer kind of thing.
The original hardware was a dedicated MIDI CC controller with this Ratio Sequencer idea as a bonus.

I’m always a bit wary of doing lots of real-time stuff on the Electra One due to the ease at which I can overload and lock up the unit.
Sometimes when it locks up I have to reboot the computer because there’s some Chrome instances sitting in Task Manager that I cannot kill.
In that scenario, I cannot start up Chrome or Edge to connect to the USB port and the E1 until I reboot.

After doing 3 or 4 reboots in a row I get sad and go do something non-computer related.

For me, the CC thing was something any box could do, but the idea behind the Ratio Sequencer was interesting.
Back in the day it was about triggering Ableton and Reason clips and other sample phrases/loops and then manipulating the triggering in real time to get different rhythms/layers going.
It was originally more about the timing and juxtaposition of the samples than about manipulating a synth.

For anyone bored/interested, I’ve attached the original manual for the MFX8. That’s what I based this preset on for the most part.

Grex MXF8.pdf (2.78 MB)

2 Likes

hehe, I know I was pushing it a little bit. Maybe there could be two presets - a simulation of the original Grex and another with a few more features.

I really hope your next I-have-a-break project will be Moog Subharmonicon clone :).

The things that make this an awesome editor and remote controller are also the things that make it a suboptimal choice for a sequencing platform.

The large, responsive touch screen, the dedicated controls, and LUA back end make for a great user experience. The 10ms resolution of the timer is more than adequate for envelopes and LFOs.

But when you try to send lots of data and do lots of screen updates, the tendency is to freeze and require a reboot.

Never played with that Moog; have to look it up

Keep in mind you can use different timers for MIDI and screen refreshes.

You can push the information to in core values from the protocol work but only push that to the screen like 10 times a second.

Agreed, but the issues I see are – is the platform designed to support use of a very low-level timer by more than one app running in parallel and the need to (re)write a good chunk of the code running between the controller and LUA and then exposing that layer somehow. LUA is not a RTOS, so there are certainly some challenges going down that road.

Not to say it can’t be done, but with 1 developer, time and resources are limited. I could see someone taking the hw platform and putting a dedicated sequencer on top, replacing the majority of the current LUA and support code with custom stuff.

Remember - no other hw sequencer platform lets users write their own apps to run in parallel on the box.
One goal for the Mk II was to allow more than one editor/controller to be running at the same time and be able to seamlessly switch between them. Not sure how a sequencer and arpeggiator and a controller using LFOs would play well together when none of them necessarily care about the others when running.

  1. I think there’s the typical editor only use case and wanting to run a bajillion editors on the fly.

  2. There’s the real time flexible midi processing use case that I’m tinkering around with in mine in WindTool (i actually don’t need multiple presets but I may add a more separate ones to do basic things).

  3. And there’s sequencer/midi generator use case you are playing around with here where the electra drives a bunch of midi output.

I think it’s amazing a general purpose swiss army knife platform can accommodate all these.

There’s really only 2 interfaces missing for RTOS

A) Monotonically increasing uptime clock down to millsecond granularity that allows for message ordering and timing

B) Outbound message queue that takes sendAt timestamp parameters (based on uptime) and schedules MIDI messages to just go as is into the output buffer without processing once the uptime clock hits the specified value (done at OS level)

Both A and B are super generic and useful for a variety of timing dependent use cases.

Then the timer for #3 just becomes schedule say the next X ms of messages and plop them on the queue when there’s only Y remaining.

Even the timer isn’t necessary in a perpetual motion machine like a sequencer if there’s outbound_queue.onMessagesRemaining() callback that wakes it up to work on the next bit of messages ahead of time before it drains (or just when empty if thats what you want).

As far as I can see there are plenty of options that don’t involve timers all the way down and could operate as smaller extensions to the interfaces…

Completely agree. That’s why I’ve spent as much time as I have making presets, answering questions, and doing testing when I can. I really believe this is one of those devices that is going to have a long life and hundreds of uses.

FWIW - I uploaded a tweaked version of this preset that handles external or internal clocking and a bit more cleanup. Still doesn’t display any incoming BPM information.

NOTE - the Mk I hardware will see and respond to an initial external MIDI clock. The Mk II may not and you may have to press the Int/Ext button first to have it looking for it (been testing a few Mk II betas, so can’t remember what the public OS does at the moment). Also, the Mk I version does tend to lock up if you’re doing a lot of heavy twisting while it’s running.

3 Likes