Tuesday 29 March 2011

MIDI Bass Pedals

The virtual organ project continues...

As I mentioned before, the key elements of the player interface for a virtual “Hammond-style” organ are...

• Keyboards
• Pedals
• Controls

The keyboards are cheap (and rather nasty) "off the shelf" items. I’ve demonstrated how to implement the controls (both simple Boolean controls and – most importantly – analog controls such as drawbars). Now it is time to confront the bass pedals.

Whilst a full-size RCO pedalboard would be nice (and remains on the wish-list for the future) a more practical 13-note pedal department will have to do for the moment. Whilst making one from scratch would be fun, there are only so many hours in the day and old organs (with perfectly serviceable pedals) are cheap.

I found such a cheap organ on eBay – won for the princely sum of a pound (pity about the diesel I burned in transporting it home).

Here is the “organ donor” – a Hammond 9422k, enjoying its last few moments in the “old keyboards’ home” next to my Fender Rhodes...


Unlike the other kind of organ donor scheme (in which – as I heard on the radio recently - the donor is left for five minutes after their heart stops – just in case), this donor was still viable. It worked. That is to say, whilst 95% of all the voices sounded dreadfully “70’s home organ” and were an insult to the name “Hammond”, I could use it to perform (at best) a parody of a Rive Gauche Cafe Accordionist. Accordingly, I admit to feeling a twinge of guilt when I broke it up for “transplant”.

I’ve saved the Leslie, the main speaker, the amplifier and the control electronics to select between them. I’ve saved the manuals (which feel so much better than my MIDI controller keyboards). I’ve salvaged several miles of hook-up wire and several dozen A733 PNP transistors. Most importantly, I salvaged a nice set of pedals (see here atop the old Workmate)...


Now – how to interface this array of switches...

I have some experience of arranging an intimate relationship between a PIC and a switch array (not least in the keypad for my multi-mode beacon). Here, I decided to use the same strategy – a group of four input lines with pull-down resistors, any of which can be pulled high by closing one of the pedal switches (you can see the 13 nice microswitches in the photo above). The switches would be addressed in groups of 4, requiring 4 “groups” to cover the 13 switches.

I created these addressable groups using a 3 – 8 line demultiplexer chip (to lower the burden on PIC I/O lines). This approach “future-proofs” the design, to allow expansion to a 2-octave (25 key) pedal board in the future.

I could have added to the program already running in the PIC16F873 which controls my drawbars – but I decided against this for several reasons...
Wiring complexity between pedals and the console
Saving code space, time and I/O pins on the PIC16F873
Availability of lots of 14 pin PICF676’s in the junk box
Production of a stand-alone solution for others to copy

Accordingly, here’s my design for a solution based on the PIC 16F676...


The pedals connect to the jumpers at bottom right of the schematic above like this...


OK – hardware is easy enough – now for the software...

The current “state” of the switches is read into two 8-bit registers “Pedals1” and “Pedals2”. This code segment shows scanning 8 keys into "Pedals1"...

These states are compared with the previous states, held in the registers imaginatively named “OldPedals1” and “OldPedals2”. Here’s the comparison for the first state register...

If there is a change between “Pedals1” and “OldPedals1” (signalled by one or more bits asserted in “DeltaP1”) the code above calls the subroutine “P1Change”...

Any asserted bit in “DeltaP1” results in a call to the relevant note subroutine – as, for example, the subroutine for the bottom C (which calls Ross Bencina's "sendmidi" subroutine via the macros "Noteon" and "Noteoff")...

Note that the settings of OldPedals are only changed after the relevant MIDI command has been sent – when OldPedals indicates that a note is “on”, it really is on – and vice-versa!

The code gives full 13-note polyphony (I’m not sure if that is a help or a hindrance!) and works perfectly. In a next version, I’ll use the extra three available switches to allow me to transpose up or down an octave – maybe.

All that remained was to cobble together an enclosure for the pedals. Here’s my “Work-in-Progress”, made out of the veneered plywood which formed the top of the old donor organ...


The system includes the (optical) swell pedal from the donor. I need to find some information on this device before I can build its interface (a question on The Organ Forum has yielded nothing but deafening silence so far). If you know anything about Hammond optical swell pedals, please contact me.

A third MIDI-USB interface arrived in the post this morning – so I’m up-and-running with two manuals, pedals, drawbars, percussion level, Leslie switch... We’re getting there!

...-.- de m0xpd

1 comment:

  1. i want one of this to play in ensemble with my 2 keyboards casio, lol

    ReplyDelete