Category Archives: Music

Teeny Tiny MIDI Controller

I’ve been working sporadically on this tiny MIDI controller.  It targets the smallest PIC microcontroller available with onboard A/D converter – the PIC10F220.

Currently it reads two potentiometers and a button input using three of the GPIO pins, and it bitbangs the remaining output pin to produce MIDI-Out at 31250hz using cycle-counted delays.  Since practically everything is already on-chip, this thing could just be epoxied straight to the enclosure.  There are only two or three more components – no PCB required!

schemThis microcontroller sports a whopping 256 instructions and 16 bytes of RAM.  Even so, the MIDI controller code consumes less than half the available resources after a modest amount of optimization for size.  One might see this as my response to using a certain 32k ROM / 2k RAM microcontroller to blink some lights, but I won’t admit to being that petty.

mplabWhat to do with the remaining space?  An easter egg isn’t a bad idea…  Hold the button down on boot, and the controller will dump “HTTP://WWW.HACKADAY.COM” as a series of MIDI note-on messages.

Unfortunately I haven’t built the thing yet, but I did simulate it.  Here’s the logic analyzer input, showing MIDI messages being sent (delays removed):

plot_editYou can listen to the result here: EasterEgg.mid

Code follows.

;
;
; Easter Egg: hold button on startup ;-)
    btfsc    GPIO,GP3    ; 2-3
    goto skip_egg

; "note on" running mode
    movlw    (0x90 | midi_channel)
    movwf output
    call serial_bitbang

; reset pointer
    clrf    egg_timer

; "HTTP://WWW.HACKADAY.COM" -> "48 54 54 50 3a 2f 2f 57 57 57 2e 48 41 43 4b 41 44 41 59 2e 43 4f 4d"
egg_loop:
; load ptr into w reg
    movfw egg_timer
; go get the next ascii value
    call egg_table

; done?
    iorlw    0x00
    btfsc STATUS,Z
    goto skip_egg

; send note (on)
    movwf output
    call serial_bitbang
; send note volume
    movlw 0x7F
    movwf output
    call serial_bitbang

; delay
    movlw 0x7F
    movwf output
egg_delay_outer:
    movlw 0x7F
    movwf temp
egg_delay_inner:
    nop
    nop
    nop
    nop
    decf    temp
    btfss    STATUS,Z
    goto egg_delay_inner
    decf    output
    btfss STATUS,Z
    goto egg_delay_outer

; send note (off) - again
    movlw egg_timer
    call egg_table
    movwf output
    call serial_bitbang
; send note volume 0x00 == off
    clrf output
    call serial_bitbang

; next ASCII char
    incf egg_timer,f

    goto egg_loop

skip_egg:
; Send the first MIDI CC message.
; ...

; ...
; rest of project code...
; ...

; lookup table for hackaday URL
egg_table:
    addwf    PCL,F    ;add offset to pc to
                    ;generate a computed goto
    retlw    0x48
    retlw    0x54
    retlw    0x54
    retlw    0x50
    retlw    0x3a
    retlw    0x2f
    retlw    0x2f
    retlw    0x57
    retlw    0x57
    retlw    0x57
    retlw    0x2e
    retlw    0x48
    retlw    0x41
    retlw    0x43
    retlw    0x4b
    retlw    0x41
    retlw    0x44
    retlw    0x41
    retlw    0x59
    retlw    0x2e
    retlw    0x43
    retlw    0x4f
    retlw    0x4d
    retlw    0x00
    END

Hornpipe2 – Test Patterns

 

Lord help me, I’m releasing an album.

When I was in late high school / early college, I wanted to make electronic music.  I didn’t have gear or experience.  My knowledge of music theory was patchy: I am a classically trained violinist, but knew almost nothing about chords.  What I did find and manage to use was Buzz Machines.  Sort of a tracker on steroids, it’s a very customizable software DAW with “machines” as plugins to be synthesizers, samplers, effects (reverb, EQ, volume, …)  Through the process of trial and error I managed to bang together a handful of trance-styled tracks that never got released.  Eventually other demands on my time crowded out my efforts and I haven’t tried to write anything in many years.

Well I’m combing through my hard drive and now I’ve found some MP3s that I had recorded “way back when”.  Most of these were composed while trying to find my way around all the features of Buzz Machines… hence the album title “Test Patterns”, since that’s essentially what they were.  When a pattern grew into something more closely resembling a song, I’d cut a WAV file and then encode it to MP3.  Those exact recordings are what I’m packing up and finally releasing now, 7-9 years after they were originally composed.  Five minutes in GIMP to create a CD cover, a little iTunes ID3 editing (the original files were named after things lying on my desk: “pocketknife”, “checkbook”, “two monitors”) and a ZIP file later… I’m a self-published recording artist.

There’s more raw material in another folder but installing Buzz Machines and tracking down years old VSTs is beyond my time or desire.  Will there be more releases, this time with new material?  Certainly I have no plans to write anything right now.  If I do decide to try that route again in the future, I want to take a different approach: one that is grounded more solidly in theory, keyboard practice, live recording, and careful song structure.  The work involved in polishing those basic skills would require far more time than I have now.  And if I do end up releasing something, it’s not going to be under the Hornpipe2 alias.  That’s a holdover from my first email address back in 1995, and I think it’s time to ditch it.  I’ve changed a lot since then.

So Merry Christmas, readers.  Enjoy the one (and only) album release.

Download Hornpipe2 – Test Patterns – ZIP archive, 26Mbytes