Vintage Rotary Phone MIDI Controller – Part 5

In this post, I describe how to use my rotary phone as a simple random-note MIDI “sequencer” of sorts.  The triggering of the notes is driven from the pulses of the dial.

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.

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 Uno
  • “GPO” or “BT” original 746 rotary telephone
  • Optional: Scrap ADSL filter
  • 120kΩ resistor
  • Arduino MIDI interface (e.g. one of these or these)
  • MIDI sound module
  • Breadboard and jumper wires

The Circuit

ArduinoRotaryPhoneMIDI_bb

This is back to a single MIDI OUT circuit, which as I mentioned before could be as simple as two resistors and a socket but here I’m using one of my Ready-Made MIDI Modules.

The connection to the phone is again as described in part 1 and I’m sending MIDI to my MT-32 yet again.

The Code

The idea this time is to ignore the actual digit being dialed, but trigger the playing of a note from the pulses received.  I’ve opted to choose a random note from a pre-defined list.  Once again I’m playing safe with a pentatonic scale, but I’ve covered five octaves and included the tonic and dominant of each octave twice, making for 37 notes to choose from in total.

#define NUM_NOTES 37
int notes[NUM_NOTES] = {
  24, 24, 26, 28, 31, 31, 33,
  36, 36, 38, 40, 43, 43, 45,
  48, 48, 50, 52, 55, 55, 57,
  60, 60, 62, 64, 67, 67, 69,
  72, 72, 74, 76, 79, 79, 81,
  84, 84
};

The basic logic is as follows:

WHEN a pulse is detected:
  Pick a random note from the list
  Send a MIDI NoteOn message for that note

WHEN the receiver is back "on hook":
  Send MIDI NoteOff messages for all notes in the list

Again I’ve gone for a sustained approach and I’m using the act of replacing the handset to send all the note off messages.  There are many other possibilities of course, but that is my starting point.

As I’m reacting to events, I thought I’d take a slightly different approach to the code though.  The basic pulse dial handling is the same as in part 2, but at each detected event I’ve defined a callback function that will be called.  The scanning code is now designed to be called from the main loop() again rather than the timer I used in part 3.

The basic structure is thus as follows.

doOnHookAction():

doOffHookAction():

doPulseAction(pulseCount):

doDigitAction(digit):

rotarySetup():
  // Called from the Arduino setup() routine

rotaryLoop():
  // Called from the Arduino loop() routine

So in my case, I’m only interested in two actions – doPulseAction() will trigger the playing of a new note; doOnHookAction() will trigger the sending of all the NoteOff messages.

The only other interesting part is choosing the random note. I’ve used the Arduino’s random() function which returns the next number in a pseudo-random sequence that is “seeded” by calling randomSeed().  It is customary to use an unconnected analog pin as the source for the seeding, so that is what I’ve done too.

Find it on GitHub here.

Closing Thoughts

I feel like there are many possibilities for generative sequences from a rotary telephone, but I’ve started with a relatively simple one.  But I think the effects are actually quite interesting even just with this!  In the video it is playing the Harmo Pan voice of my MT-32.

It would be interesting to explore ways have having discrete notes.  Maybe each digit could trigger a different track in a sequence?  Or perhaps it could create a rhythm somehow.

Another option I’d like to explore at some point is perhaps using the pulses as the clock trigger for another sequencer, so there is still plenty of experimenting possible now the basic idea of “doing something on an event from the telephone” has been established.

Kevin

IMG_5922

Leave a comment