Vintage Rotary Phone MIDI Controller – Part 7

Having built my adaptor into a small box, I’ve gone back to add a mode button so I can include all the different applications into a single sketch.

This builds on the previous parts in this series.

  • Part 1 – Understanding the telephone hardware and interfacing to an Arduino.
  • Part 2 – Decoding the rotary dial from the Arduino.
  • Part 3 – Rotary phone MIDI note controller.
  • Part 4 – Rotary phone MIDI program change.
  • Part 5 – Rotary phone MIDI random note sequencer.
  • Part 6 – Rotary phone to MIDI adaptor.
  • Part 7 – Rotary phone multi-mode applications.

IMG_6003

Warning! I strongly recommend using old or second hand equipment for your experiments.  I am not responsible for any damage to expensive instruments!

If you are new to Arduino, see the Getting Started pages.

Parts list

  • Arduino 5V Pro Mini (as I’m soldering it in, I’m using a cheap clone)
  • “GPO” or “BT” original 746 rotary telephone
  • Scrap ADSL filter
  • 120kΩ resistor
  • 2x 220Ω resistors
  • Chassis mount 5-pin DIN socket
  • RJ11 telephone cable (cut in half) – this is the “handset” cable or possibly a “modem” cable
  • USB cable (cut in half)
  • MIDI sound module

The Circuit

RotaryPhoneProMini2_bb

The idea is to simply add a push-button switch to the build from part 6, so I’m taking that as my starting point.  I’m adding a button between D3 and GND, using it in INPUT_PULLUP mode.

I made a hole in the case and made a small cut-out in the PCB to hold the button relatively firmly in place, then connected it as shown below.

Aside: I somehow managed to break the leg off the resistor between 5V and the MIDI socket, but didn’t notice until I tried it and nothing worked – so that was a bit of a pain, as I needed to gently prize everything apart enough to get a new resistor soldered in place!

The Code

So, the main idea is to use the button to change between the various modes of the phone.  I’ve implemented the following:

  • Mode 1 – Send MIDI Control Change 16 – General Purpose Controller 1 – with the digit as the value (0 to 9).
  • Mode 2 – Play NoteOn messages for C major, starting with MIDI note 60 (C4) for 0.
  • Mode 3 – Play NoteOn messages for a pentatonic scale, as described in the “simple mode” from part 3.
  • Mode 4 – Play NoteOn messages for several pentatonic scales, as described in the “complex mode” from part 3.
  • Mode 5 – Send MIDI Program Change messages as described in part 4.

Note that I haven’t implemented the sequencer as described in part 5 as the code structure is quite different to the other modes.

Also note, if you examine the code, the modes are encoded as 0 to 4 within the code itself.

The main logic is as follows:

Loop:
IF button pressed THEN
  switch to the next mode
IF there is a new digit read THEN
  IF in Control Change mode THEN
    Send MIDI General Purpose Controller 1 CC Message with value "digit"
  ELSE IF in Program Change mode THEN
    Update the program change number
  ELSE
    Check which scale we're using AND
    Send the associated MIDI NoteOn message for that digit in that scale

IF phone is placed back on the hook THEN
   IF in Control Change mode THEN nothing to do
   ELSE IF in Program Change mode THEN
      Send the MIDI Program Change message
   ELSE
     Send a MIDI NoteOff message for all notes from all scale modes, for all digits

Once again I’ve implemented it so that all notes sustain until the phone is placed back “on hook” when I simply cycle through all notes in all scales sending NoteOff messages.  This is a little redundant but does mean that if the mode had changed after notes started playing, then all notes will eventually be turned off properly.

The last thing I’ve added was some indication of which mode we’re in.  When the button is pressed and the mode changed, it will play a few notes from the C major scale starting on C5 to indicate the number of the mode (1 to 5).

Find it on GitHub here.

Closing Thoughts

I’m still wondering if it would be better to have specific MIDI messages defined for the different events within the phone, and I’m part way there with the use of the first general purpose CC message.  It might be useful to also have a CC message defined for on-hook and off-hook too.

I’ve also wondered if I should have a mode that plays proper NoteOn/NoteOff messages when dialing.  I might still implement that for the C major scale mode – I’m still deciding!  I also use the built-in LED to indicate a button press, but I might update it to flash to indicate the mode too, again I’m not sure yet.

The MIDI channel is still hard-coded to 1, and to be honest that is fine for me for now.  I would like to find a way to get the sequencer functionality in there somehow, but need to think about that a little more. I was also wondering if I should generate MIDI real-time clock messages in response to the pulses, but again I’m still chewing that over too.  I have plenty of IO pins on the Arduino spare, but not a lot of space in the casing.

I have managed to pick up a second phone and on simple inspection it appears to be wired up the same as my original phone – but for some reason it isn’t reliably detecting pulses, so I need to look at that at some point too.

So there are still plenty of things I could do next!

Kevin

Leave a comment