Jump to content

MBLoopA: Voxelspace MIDI recorder and clip looper


Recommended Posts




we recently had some very rainy days in southern Germany and MIDIbox-build-fever struck again, so I had to do something... my project build stack is very large, and even some started projects are not complete yet (MBProgramma), but this one has been on the wishlist for even longer than the Programma, so I just had to start it this year... otherwise it would probably never happen :-).


I have to say, that the MIDIbox platform is phenomenal and addictive! It would be so nice to work on something of this quality on a daily job basis... results can be reached very quickly, the documentation and code base is great. Thanks a lot for everything, TK.!


Let's start...



* DAW hate

Turning on the computer and loading a DAW as complex as Ableton or Cubase makes sure any of my already limited inspiration will be gone by the time it is able to record MIDI. I'd like to sit down and "just jam". I felt, very often, that what i played was lost in time, because, of course, the computer was off. So I wanted a simple MIDI recorder, that "just records" automatically a few seconds after turning it on, without any major interaction. If what was just played sounded nice, it would be automatically stored on SD card in compatible .MID format for later playback or even some DAW-based post-processing. If not, well, one could just jam on, or delete the track (called clip in this app).


* Hardware minimalism

Building the unit should be quick and cheap. There should only be a minimum number of buttons and encoders. I managed to build everything including the control surface (yes, i know, it looks cheap, but it also was cheap :-)) on one long weekend - and so can you. We just use standard hardware (STM32F4 core, one DINx4, out DOUTx4 and a nice display). Because there are few components, it is very viable to do it on vector board, no immediate need for PCBs...


* Space minimalism

As we all have very limited available upfront space in our studios, the unit is separated into a very small control surface (16x8x1.5cm), which is connected with a 40-PIN old-computer-IDE cable to the base unit, that contains the Core, the MIDI ports and the DIN/DOUT modules.


* Bling

Every MIDIbox needs a bit of bling... I always wanted to use that 256x64px OLED from Newhaven. TK. helped me in getting it connected a few years ago, but we never managed to initialise it 100% (there was some flicker). Meanwhile, Newhaven updated their Datasheets, and after further experimentation, the display now works very nicely and is flicker free. The display is still available on the market, and there even has been a reissue from Newhaven - it came to stay at least for a while, it seems. The 16 grey/blue levels are fantastic! Connection to a STM32F4 is very straightforward, you just need a 3V3 regulator, as the onboard STM32F4 regulator is too weak.



Functionality (already completed)

* Realtime MIDI Recording and playback (functionality cloned from the MIDIO128 MIDI recorder, thanks for that! :-)) of nearly unlimited length to compatible .MID files for later postprocessing. No quantisation or step-recording, we have the MBSEQ for that job!


* Graphical Note output. For bling reasons, we currently display notes in voxel space. That means, when a note is played, a "mountain" is drawn - left side are the low keys, right side the high keys - the mountainscape is scrolled continously, so that we "paint" a mountainrange while flying over it. Beats/quarternote timing is indicated in the mountainrange, by an area of "even terrain". Higher mountains = higher key velocity/louder notes. A demo video should be up soon :-). Smooth framebuffered playback @ ~30fps, the STM32F4 is great! :smile:


* Proper MIDI sync with a MBSEQ V4. This was very important, as the SEQ is the mastermind and controls all MIDI synths here. Pushing play on the SEQ, while the loopa is armed will record "in sync". The same applies for playback: when a clip is armed for playback, and the SEQ is started, it will playback in sync with the MBSEQ as a MIDI timing master. This already really works really well, and i spent the last night just smiling and jamming! :smile:


* Beat LEDs are working - the leftmost is a red LED and will blink on every beat/ quarternote (like MBSEQ), there are three more green LEDs, which will flash on the 16th notes.


* The illuminated clip switches are working. For later on, the illuminated switch will show, if a clip is "filled" with MIDI data (solid on), is armed for playback (blinking slowly, every quarternote) or is armed for recording (blinking quickly, every 16th note).


Work in Progress/Wishlist

This will likely take a a lot more weekends of programming and adding code to be complete. But then, I really love to see small steps of progress. Even now, just a few days after starting with the project, the unit is quite usable, although it just records to SD and plays back a single clip and draws some nice voxelspace mountains while doing so :-).


Further items on the wishlist are (all unfinished, yet):

* Support for a graphical variable-width-letter font, that supports the 16 shading levels of the OLED. This allows to use an antialiased font for a clear display and "visually round font corners".

* Support for playing back up to eight pre-recorded clips in parallel (currently only one clip is supported). The idea is to load the MIDI files into memory and play them back with a mute/unmute feature like in the MBSEQ V4.

* Support for synchronized muting/unmuting of clips

* Support for looped clips

* Support for editing clip start/endpoints, e.g. for loops or for one-shot playback (with the left and right encoders)

* Support for multiple sessions (one session holds eight clips)

* Support for a 2D noteroll display (toggle "Mode" button to switch between 3D voxelspace and 2D noteroll is already reserved :smile:)


... hope you like it so far, i will update this thread, when new changes are made to the software.


Have a great time!



Edited by Hawkeye
  • Like 1
Link to comment
Share on other sites

I also need a Loopa for my Synth-Guitarist... also realtime recording... and no need for edit and so on... (he is able to play it again if it was no good recording... while i cant...)


YESS!!! > http://svnmios.midibox.org/listing.php?repname=svn.mios32&path=%2Fplayground%2Fhawkeye%2Fmbloopa%2F


thankz for that, this could make it easier to adapt it to my guitarist whises (the whole seq4 is to complex for me...)



(ich brauch so ein teil schon seit dezember...zeitmangel, motivationsmangel, trägheit, und Komplexität vom SEQ4 und trozdem... und schwups die wups - ein paar monate später- gibts so ein Teil - Hoch Lebe DIY Open Source Kooperation und der Erfindungsgeist)

Edited by Phatline
Link to comment
Share on other sites

Cool! :phone: 

The big thanks goes to TK who made all of this possible and coded 95% of it, this is (for now) just a code remix of MIDIO and my old voxelspace demo...



In the loopa, the display flyby is reverted, the notes appear in front of the screen and "fly back" as mountainline. It feels very responsive and should be an inspirational little tool (better than any windows laptop), I'll put up a video, once the font renderer works, and we see some more of the stuff, that is going on (like the current clip position) while recording :-).


Have a great day!


Link to comment
Share on other sites


Hawk that is amazing really

Thanks tk and hawk and wilba and all the community amazing work

Im just close to get the parts and assembly my seq and ready with some ideas and wanting more jejeje

And now i want that clouds looper amazing work at my point of view the best paltform on earth for controllerism. Keep them coming ðŸºðŸºðŸºðŸ»ðŸ»ðŸ»

Link to comment
Share on other sites



Meanwhile, the 16-greyscale levels font renderer works (it is already commited in the repository) and can be used for "font outline" and "font overlay" effects. The loopa can now be used as a standard one-track recorder with playback with visual voxel output. This is basically just the MIDIO functionality with simplified use with four buttons (Play/Stop, Arm Record/Record, Previous Track on SD, Next Track on SD).


Am now trying to play back multiple MIDI files at once, which should work, because TK. did some amazing work with prebuffered MIDI-file reads from the SD card. You can basically define how many MIDI events should be preloaded from the MIDI-file, before they are inserted into the sequencer module. As long as the SD card is fast enough, there should be no buffer underruns and all should be in sync... let's hope for the best! :smile:


Last evening, the gurl stopped by and asked if i build a new retro car radio. So much for the ugly design. I hope it just needs a manufactured aluminum/plexiglass frontpanel ;-).


Hehe, have a great day!



Edited by Hawkeye
Link to comment
Share on other sites

Great work! :)

And I'm not surprised that you added some bling as well ;-)


For multi-channel recording I would recommend a different approach: with each loop, just record the old and new MIDI data into a new file, switch to this file with the next loop and delete the old file. Alternatively store the MIDI data in SRAM (STM32F4 memory is large enough for this purpose)


Best Regards, Thorsten.

Link to comment
Share on other sites

Thanks a lot, J and TK.! :smile:


There has been a little bit of progress (already commited) - recording to incremental MIDIs in each clip slot works now, as well as parallel playback of multiple clips. Great idea with using new filenames when starting a new recording session! Unlooped playback of normal recordings seems nice and in sync, no problems with SD card speed :-)

SRAM would have been my first choice, too (especially regarding timing), but after some experiments (the voxels need some RAM, too), i only managed to allocate around 800 midi events (2 events for note on/off) on each of the eight tracks, so i stopped there, basically because i wanted to record potentially really long jamming sessions, so recording to SD was a must... but that works fine (i have not tried parallel recording and playback yet).


For clip loop playbacks, I still have a logic problem, that is a bit too complex right now :-)

We have pre-fetched MIDI-Events from clips on SD card, that need to be fetched a bit before their "time", so the sequencer can play them just at the right moment. For the clip loops, at some point in time, we need to jump back to an earlier file position (loop start point, e.g. start of midi track), but it is difficult to determine, when that rewind (followed by a prefetch) needs to occur, for the clip to be exactly in sync with the song. Need to think more about it - any thoughts are welcome! :-). I think, some kind of a loop-hint index is necessary, but my brain is hurting ;-)


Many greets and have a great day!


Edited by Hawkeye
Link to comment
Share on other sites

Science Breakthrough! :alien:

It will have to do for the first iteration. A few glitches/bugs and quite some extensions on the wishlist, but it will have to wait - celebrating the nice summer now :afro:
Many greets!
Peter Edited by Hawkeye
Link to comment
Share on other sites

Thanks, Altitude! Creating a dedicated CS PCB depends a bit on demand - i'd love to see one created, but have no experience in PCB-routing and do enjoy summertime more, right now :smile:.


It is a pretty small setup, it should not be too costly to create and could be used for other MIDIbox projects, as well (kind of a super-SCS). It would incorporate just a nice graphical display, 2 pushable encoders, 12 switches + 12 switch LEDs. It would be great, if the shift registers would be onboard (like on Wilba's SEQ PCB). External ports: only the display connection (16 pins) and a serial connection (10 pins) to the core.


So, if anyone wants this bad, please step ahead! :-) I would then supply a template for an aluminum frontpanel for the LoopA on top :-).


Many greets,


Edited by Hawkeye
Link to comment
Share on other sites

Very cool! :D


For the parts: The display is a Newhaven NHD-3.12-25664UCB2, which is available on mouser and digikey.

The illuminated tactile switches are from MEC (reichelt), but it probably makes sense to use something available on mouser/digikey, too.

The encoders are alps stec 12mm encoders with switch, but it would be ok to also use any 16mm encoder with switch (that is also available from mouser/digikey).


The control surface consists just of standard MIDIbox DIN -> switch/encoder, and DOUT -> LED wiring, it is all in the ucapps.de schems :-):


We need a DOUTx2 module for 16 LEDs: 12 switch-LEDs and four beatstep LEDs.

We need a DINx3 module for 18 input connections: 12 switches, 2x2 lines for the encoders and 2x1 lines for the encoder switches.

(i know, 18 is not a good number of input lines, but the encoder switches will be used for the menu system, later on ;-)).

How it's mapped does not matter, it can be reconfigured in the software, just make sure, the encoder lines are on the first DIN shift register, pins 0, 1, 2 and 3 for encoders 1+2.


The display is basically connected like the small OLEDs used everywhere, but it needs a 3V3 regulator, as the onboard reg on the STM32F4 is too weak.

I'll draw up something, once it is less hot here in Germany :-))


Space-wise it would be nice to build it as small as possible (the shown prototype is like 8x14cm or so), this keeps the cost and the studio footprint down.


Have a great day!


Link to comment
Share on other sites

this is realtime record - no step based... but the length - i think - is step-counted (miditicks)?

if the 4 LEDs are showing this - i think it is counting in 4er...8 16 32 64


my quest: it would be nice if  i could choose un-straight counting like 3er, 6er 12er... (the setupd- counter structure is saved in the song, if the song is 3er based all 4 loops in this songs are 3er based)


my synth-guitarist alwasys ask me to make un-straight beats... with my korg er1 it is possible...it just counts to 12 instead to 16...... in with his RC300 of course also 3er are possible... and i must say after one year playing with him i - am in love with 3er...

Link to comment
Share on other sites

Fully agreed, J! :smile:


Altitude, I've attached the connection diagram for the SSD1322 display :-)

To see the correct mapping, this link will also help (the wiring is very similar to the ssd1306): http://ucapps.de/mbhp/mbhp_lcd_ssd1306_single_mios32.pdf


Here is the connection table in verbal form:


SSD1322 256x64px Connection Pins

GND: Pins 1, 5, 6, 10, 11, 12, 13, 14, 19, 20
+3V3: Pin 2
NC: Pins 3, 9, 15, 18
DC (=RS Pin on MIDIbox Core): Pin 4
SCLK (=E Pin on MIDIbox Core): Pin 7
SDA (=RW Pin on MIDIbox Core): Pin 8
Reset (Active low, slow pulled high on powerup with 10uF cap/1K resistor, see schem): Pin 16
CS (=D0 Pin on MIDIbox Core): Pin 17


Regarding the voltage supply: a LF33 or any other low-drop 3 or 3.3V vreg is nice (no switcher recommended, the OLED is very sensitive regarding stable voltage, but the standard-size linear vregs will do without additional passive cooling) and a 47uF/100nF pair to stabilize pins 1/2 is recommended (not in the diagram, probably not necessary, when the vreg and the vreg output cap is nearby). The STM32F4 Core should be jumpered to 3.3V (display lines), but the display seems to be able to tolerate 5V on the datalines (made a mistake first, but nuthin' burned ;-)). It probably does not withstand 5V on pins 1/2, so be careful :-).


I'd recommend to build a test wiring first before finalizing the PCB, i can send you the .hex to get some output, if needed :-)


Many greets and have a great weekend,




EDIT: Phatine: yes, recording is in real-time, but it displays steps for orientation, just as the MBSEQ does. It would be no problem to play in any other timesignatures, as it is realtime, it plays back whatever you recorded. Currently, the clip length is forced to be a multiple of 16 steps (16th notes), to allow for nice looping with other clips, but this is easily configurable to any other value and might be a UI setting later on (and the beat leds can be rewritten for 3-parts based counting, if you like, it is just some simple c-modulo logic :smile:).


Edited by Hawkeye
Link to comment
Share on other sites

Hi TK.,

thanks a lot! It was only possible because of the awesome MIDIbox framework, but it also still needs some work done (e.g. to send "midi note-offs", when a clip is muted during playback :smile:), but it is very enjoyable work! :smile:


Currently, the loopa probably also does not exactly behave like you would expect it to work :smile:.

Each track/clip is currently recorded independently from the lengths of the others and has no pre-configured clip or loop-length, once recording is started.

So you can record a minutes-long live-jam to a clip, just as the guitarist does in the above video and not lose it in time :smile: (which might happen, if there was a pre-configured loop-recording length, the jam duration is not known beforehand).


Once a clip is recorded, it has a defined length and will then loop around it. One important item on the to-do-list is the option to loop around a per-clip-configurabe loop start and endpoint (counted in MBSEQ-compatible steps). The advantage is, that you can "post process" your recording, e.g. if you needed a few times to play a passage correctly without errors, you just leave the recorder on, and once you managed to play it correctly, you stop recording and just "cut out" the take you liked best and loop around that section.


I know, this workflow is a bit different to a classic audio looper... but it is quite straightforward for me - just record, until you like a segment, then afterwards adjust the loop points around it and forget the rest. Great idea with parallel-wiring the arm/record switch onto a footswitch, this will make recording even easier, thanks for the tip, i will soon have to adapt this! :smile:


Many greets for now, enjoy the summer! :smile:



Edited by Hawkeye
Link to comment
Share on other sites

very cool!

tomorrow i will order such a display, the rest i have @ home.


dont miss understand that as "auftrag" i write down my needings, and my idea, i need some simular device, and maybe the ideas which came up can bring us forward a bit...


I am thinking about to built that the device in a 19" case, with midi conection to my already built footboard (with virtual buttons and displays and so on....) - fully controllable over the 19" case, and via midi the most interesting record and loop features in a jam situation e.g. Start Stop Loops, Record Loops, changing Loop length (offset/shift, length)


yes the "always record mode"... i told my guitarist about that, and he was not very family with the idea, to always record, and then when he thougt it was good to press record and it was done >>> i think he learned it about the old way -press record, press stop > and now he cant think that there is  a better way "was der bauer nicht kennt frisst er nicht..." - for me as a human that want to express my self ONCE - and once it is done i will express me a other way - because otherwhise it would be boring... ok for me as a ONCE-Man i want to express the holy vibration once - and in this moment it is perfect! (oh it is always the first time you press on a keyboard...) the Machine have to capture this moment and have to loop that moment over and over over - while my guitarist want to repeat and repeat and repeat it ever and ever he says that is ReProducing-ability or something... i think just make that the device and say "PLAY!"


i thougt about the idea the last years... and there came out a few designs..

-1 Button - Move all the data in a cycle reward - it make sense to install some scroll mechanism - e.g. longer press automatic continue the shifting stepwise

+1 Button - Move all the data in a cycle forward -     --//--   --//--    -  maybe other technologies have to be used - IR-Transistors and LED-Arrays....


when you have just pressed the Always Recording-Button , you use normally the +1 button to shift the last recordet notes to the start of the loop... and a loop is long maybe something aroung 512 (in steps) so it is generally not hearable... the last recordet notes generally are not played good, because you was focused to find the RECord button and press it... maybe a automatic mode with a standard +Offset that is triggerd with the REC-Button is a solution,

how much steps (3 4 6 8...) automatic offset? > that is a user definied question and depends on how fast can a musican act, and how far are the ways to the Record Buttons... so it has to be changed via the Display-Menue.


Yes and of course -16 and + 16 Buttons (in 3er Mode these are automaticly -12 +12) Buttons which change the loop length

thinkable extra buttons parallel to the -16 +16 Buttons would be "doubled Length" Buttons which change by the first step -32, - 64, -128, -256, -512

just to jump faster to the "right" positions - and as nice side effect - when you always use this "doubled Length" buttons the 4 Loops are always in "Sync" >>> a 48 step loop and a 64 steps are always shifting around, in its endless loopness.... a 64 length loop and a  128 length loop will always play stable in the same playing to gether ---- maybe by playing mono-lead or bass sounds it does not matter, but when you play rich cords with half tones and full tones.... and on the other loop also...you can think there are moments when it sounds not so good.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Create New...