1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Custom MIDI processor built on Arduino

Discussion in 'A/V' started by zambari, Jan 11, 2010.

  1. zambari

    zambari video freak

    Well, not quite finally built, but I've got a working prototype.
    I've spent last three weeks of dec 2009 coding and working stuff out, and got to my first milestone, now I don't know how many weeks/months/years will pass before I'll find myself motivated enough to finish it so I decided to post it here and maybe discuss some ideas with fellow audiovisualists.


    Feature list:
    - 2 track MIDI sequencer, record, play in loop, resyncable playback, variable loop length (independent of master sequencer)

    - LastKnobā„¢ feature lets you learn messages sent one of ESX knobs via NRPN, and keep sending that message when you rotate a potentiometer, so you can keep on riding on that filter with one hand and start tweaking something on a different channel on ESX at the same time

    - Global Volume control for Korg ESX - allows to fade out all channels simultaneously, you can leave one by holding its volume up on ESX

    - When turned on in V4 in MIDI chain it sends a couple of SysEX messages to map V4 to channel 16, output fade to CC 10 (pan) and main mix to CC 7 (volume). This way I don't have to waste time to set up V4 when using a provided one

    - Plays back nice hand-tweaked video mixing curve in sync with video field rate (20ms), triggerable by any ESX drum track, to use with V4 video mixer or KTV video sampler to mix between channels using ESX as a sequencer - with manual or programmed trigger.

    - Sends bursts of MIDI to go through MIDI-DMX converter and drive a strobe light - triggerable by any (selectable) Drum track on ESX or through interval system

    - Simple clocking systems allows triggering of V4 Flashes, V4 MIX or Strobe pulses in desired intervals, from 1/16 note to 8 bars

    - i have to make some final decisions on interface logic
    - ESX/ES1 NRPN to CC converter
    - finish implementing KTV support
    - shortcut system
    - real-time aware midi clock regeneration when clock frames start to go missing due to intensive traffic
    - more LastKnobs maybe - there are still some free analogIns on arduino but I don't want to waste too many cycles on reads


    That's the last picture of the prototype I have, before I attatched analog knob (then it got moved to a box somewhere). The one on the left is an endless encoder, connected via PISO shift register together with 6 buttons. Big mess in the wiring I know but I had to change from 74HC166 to 74HCT597 (at least I learned a difference between HCT and HC (HC is CMOS only - not TTL as arduino)
    Last edited: Feb 11, 2010
  2. bilderbuchi

    bilderbuchi in the pixel hotspot

    very nice. which arduino did you use?
    currently, i'm using the midibox stuff for things like that (slide projector remote and such. planning to do a step sequencer/clock distributor one day)
  3. allume

    allume vjing gave my youth back

    wow man.
    Your work amazed me....

    I'm working on the same thing, but OSC related, realing with Arduino OSC library and Ethernet Shield.
    Easier, then.

    Are you using the Arduino MIDI Shield from LAdyAda or built everything from scratch?

    Since I'm on a coding/designing stage I'm imaging analogIn drive from Sharp IR RangeFinder, Scratchpads built out of old HD (or my old Dm2).
    How do you bypass Pots and bad Sliders (haven't found any good non-logarytmic sliders around)? What about noisy numbers on the analogIns printouts?

    Are you gonna share some code?
  4. allume

    allume vjing gave my youth back

    are you gonna make your own Brain Arduino Shield?
    Did you use Fritzing to develop the all thing?
  5. zambari

    zambari video freak

    i used Arduino Duemilanove, on ATmega328. It has 2k of RAM instead of 1k on 168, and i ended up using 1.8k already (199b free), trying to conserve memory as much as I could. Sequencers can hold only 28 notes each, made with two 54*2 int arrays, first int with timestamp of the event (relative to midi beat clock), second is note with oldest bit used to differentiate between note on and off messages.

    Step sequencer would be easier but I would have to have arrays full of zeroes so I couldn't fit longer sequences in, and the whole point was to enable longer pads without longer patterns on electribe (i hate having to repeat programin hihat pattern 8 times - that just doesn't do it for me, so I have to keep my drum patterns short to be able to edit them on fly)

    it all works fine as long as you don't flood midi (300bpm + lots of action does flood it), then clock messages start being dropped (most likely not sent by the sequencer), and a slow drift starts.

    I might one day write more on that subject
  6. allume

    allume vjing gave my youth back

    tell us, then ;)
  7. zambari

    zambari video freak

    I've used sparkfun protoshield and did midi on it (cutting some tracks and using some existing ones, with optocoupler and few resistors),
    I used this tutorial for the hardware side of midi, but I didn't any of that code


    midi uses serial in and out, so I mounted a small switch on it to block midi in while programming the board, otherwise midi clock screws usb transmission as they use the same pin on atmega

    Than I connected LCD display using ladyaga's tutorial (and her pin numbers for compatibility),

    than added a shift register to support more keys and rotary encoder and that's about it, hardware side. working out the shift register took me a while (mainly because the register i was trying to use didn't work with arduino properly and never will) but midi and lcd didn't take more than one evening each

    I took some pictures of the process but I can't find them now, I hope I haven't lost them

    code is a bit messy, so although I will most likely publish it at some point but it may be a bit too early for such a wide disclosure. if anyone wants a private peek at it just pm me
  8. allume

    allume vjing gave my youth back


    really cool.
    I advice you to use MC 4067 shift register (16 analog input on 1).
    I keep on study. :p

  9. zambari

    zambari video freak

  10. allume

    allume vjing gave my youth back

    Hi Zambari.
    I've given a look at your prototype.
    Looks very good!

    Tomorrow I'll drive through all the prototyping process.
    It's a nice worklog too.


Share This Page