Audio via Arduino 16-bit PWM

Most of my project postings described a project in a completed state with full code, electronic design, etc. This post covers some things that I’ve learned during my current open investigation. Think of it as a “breather” before the next push.

Audio folks who get into Arduino often ask, “Gee, why not use PWM to produce audio — a poor man’s DAC?” 8-bit PWM resolution is the default supported PWM mode. The resolution and the bandwidth is not sufficient to support decent audio. First off, the PWM stream must be converted to an analog signal using a low pass filter, with a typical corner frequency of 150Hz or so. The default mode is really intended to control servos and such.

The littleBits Arduino is a good example implementation. The PWM outputs have a filter to convert the PWM bit stream to an analog voltage. The filter can be switched off if you want access to the raw digital data or PWM bit stream, making the Arduino’s outputs quite versatile. Depending upon your perspective, the littleBits filter is quite good for low bandwidth applications, not so good for audio. In fairness, littleBits never claim to support audio via their PCM hardware.

The PWM signals are generated by the Arduino’s timer/counter hardware. The Arduino UNO and Leonardo, for example, have three timers which can generate a PWM signal:

  1. TIMER0: 8-bit PWM, pins D5 and D6, delay()
  2. TIMER1: 8-bit and 16-bit PWM, pins D9 and D10
  3. TIMER2: 8-bit PWM, pins D3 and D11, tone()

Timers 0 and 2 are used by the Arduino delay() and tone() functions, respectively. So, you cannot use these functions and expect to generate PWM at the same time.

All appears lost for audio until one discovers TIMER1’s 16-bit PWM mode. I decided to try 16-bit PWM on the littleBits Arduino with the hope that the pre-existing filter would successfully convert the PWM bit stream to audio.

Long story short, the littleBits filter is too good at its job! The filter looks to be an active Sallen-Key low-pass filter with a corner frequency of 49 Hertz. Through much of my experimentation, I sent percussive samples (e.g., open high hat and cymbal) through TIMER1’s PWM channel. The littleBits filter neatly removes all of the high frequency signal resulting in a low frequency thud like a kick drum or low tom.

So, instead, I decided to switch off the littleBits filter and convert the PWM bit stream through a passive, low-pass filter of my own. The following table summarizes the RC components and filter characteristics that I tried:

    Resistor                  Capacitor  Corner frequency
    ------------------------  ---------  ----------------
    100 (Brown Black Brown)     0.1uF     15915 Hertz
  * 150 (Brown Green Brown)     0.1uF     10610 Hertz *
    220 (Red Red Brown)         0.1uF      7234 Hertz
    330 (Orange Orange Brown)   0.1uF      4822 Hertz
     1K (Brown Black Red)       0.1uF      1592 Hertz
    10K (Brown Black Orange)    0.1uF       159 Hertz

I held the capacitance constant in order to find the best resistance for the filter. The 150 ohm resistor worked best. It produced the best quality audio with the least artifacts although I still need to tame a high pitched whine. I may have to add another filter stage (a so-called “2-pole” or “second order” filter). The corner frequency is roughly the Nyquist frequency — no accident.

At this point, it probably appears that it was a smooth ride from start to finish. Nothing could be further from the truth! Here are a few “learning moments” from the journey.

First, be sure your power is clean. I started out with a switching power supply that successfully drives Arduinos big and small. The output signal had a raunchy buzz that I could not extinguish with the filter. Turns out, the switching supply is noisier than heck and the noise gets into the audio. I replaced the switching power supply with a clunky, old, heavy Yamaha PA-3B and the raunchy buzz went away.

Next, don’t trust code that you find on the Web. I started with timer configuration code from what appears to be a reputable site. After hours of frustration, I read up on the TIMER1 hardware and rewrote the code. The original code simply could not have worked as it set non-existent bits in the timer control registers! Here is my timer configuration code and interrupt service routine (ISR).

    //
    // TIMER1 PWM. Single PWM, phase correct, 22050KHz.
    // PWM_FREQ = 16,000,000 / 22,050 =  726 = 0x2D5
    // PWM_FREQ = 16,000,000 / 11,025 = 1451 = 0x5AB
    //
    #define PWM_FREQ   363

    void PwmSetup() {
      // Clear OC1 on compare match, 8-bit PWM
      //TCCR1A = _BV(COM1A1) | _BV(WGM10) ;
      TCCR1A = _BV(COM1A1) ;
      // PWM TOP is OCR1A,  No prescaler
      TCCR1B = _BV(WGM13) | _BV(CS10) ;
      // Generate interrupt on input capture
      TIMSK1 = _BV(ICIE1) ;
      // Set input capture register to sampling frequency
      ICR1H = (PWM_FREQ >> 8) ;
      ICR1L = (PWM_FREQ & 0xff) ;
      // Turn on the output pin D9
      DDRB |= _BV(5) ;
      sei() ;
    }

    //
    // Interrupt service routine (ISR)
    //
    ISR(TIMER1_CAPT_vect) {
      if (sampleCount > 0) {
        sample = (int8_t)pgm_read_byte_near(sampleArray+sampleIndex) ;
        dacValue = sample  ;

         // Output through OC1A
        dacValue += 127 ;
        OCR1AH = (uint8_t) (dacValue >> 8) & 0xFF ;
        OCR1AL = (uint8_t) dacValue & 0xFF ;
  
        sampleCount-- ;
        sampleIndex++ ;
        TXLED1 ;
      } else {
        TXLED0 ;
      }
    }

TIMER1 implements a bit capture capability along with the PWM generation stuff. The bit capture counter is configured to generate sampling interrupts, i.e., the PWM side is fed at a 20,050 samples per second rate. The output compare register controls generation of the PWM signal. It’s the place where a sample is fed.

If you go to use this code, the samples are stored in program memory (PROGMEM) and are 22,050Hz, 8-bit, mono. The sampleArray contains the samples. The two global variables sampleCount and sampleIndex control sample selection from the array. The sampleCount is preloaded with the number of samples in the array by the loop() function. The TXLED macros only work on Leonardo and indicate when samples are being played or not. These macros could be removed in production code.

Third, get the sampling frequency right. Corollary: Use a pitched sound like a sine wave of known frequency to make sure that the sampling frequency is correctly configured. The PWM generation in this design is configured to be phase correct, which halves the frequency. High frequency content becomes even more “thud-like” at a lower frequency making it difficult to sort out other configuration and filter issues. I got around this barrier by feeding a digitized 440 Hertz sine wave into the PWM conversion. When the tone sounded an octave lower than expected, I realized that I needed to double the configured sampling frequency.

Trust me, the road was not straight and smooth. I didn’t make progress on filter design until these issues were resolved. Science and engineering ain’t so simple, but the challenge is both fun and rewarding.

Update 18 July 2016: Take a sneak peek at the source code for the Arduino Beat Box (TR-808 lo-fi drum machine). The source code contains the final TIMER1 set-up and interrupt service routines.

Connect a MIDI shield to littleBits Arduino

My do-it-yourself MIDI interface for littleBits Arduino probably isn’t for everyone. Constructing the DIY interface requires circuit layout skills and not everyone wants to whip up a board from scratch and a schematic.

Fortunately, there are a couple of alternatives: the Olimex SHIELD-MIDI and the Sparkfun MIDI Shield. I don’t have any direct experience with the Olimex, but I have built and used the Sparkfun MIDI Shield (Sparkfun product number DEV-12898) and the now retired MIDI Breakout Board. The Olimex SHIELD-MIDI is very similar to the retired breakout board. In this post, I show how to hookup the Sparkfun MIDI Breakout Board to the littleBits Arduino. The wiring is the same for the Sparkfun MIDI Shield. That’s the neat thing about the standard Arduino form factor.

I would demonstrate with a Sparkfun MIDI Shield, but all of my MIDI Shields are customized in some way! The Sparkfun MIDI Breakout Board is basically the same as the MIDI Shield except that it doesn’t have the potentiometers and tactile switches. The image below is a picture of the Sparkfun MIDI Breakout board. (Click on the image to get higher resolution.) The two 5-pin DIN connectors are the MIDI IN and MIDI OUT ports. The long pins extending below the breakout board plug into a standard Arduino like an UNO or Leonardo.

sparkfun_midi_breakout

The Sparkfun MIDI breakout board (or shield) arrives as a kit, so you still need to do some assembly. Sparkfun has already installed and soldered the tough stuff like the optoisolator, resistors and so forth. The MIDI Shield is a good beginner’s kit because the components to be installed are large and easy to solder. If you skip installing the potentiometers and tactile switches, the job is even easier!

You might want to add an Arduino Stackable Header Kit (PRT-10007), however. With the header kit, you’ll be able to interconnect using standard jumper wires. Once the headers are installed, no further soldering is necessary. Just plug the jumpers into the headers and play. Mistakes are easier to correct with jumper wires, too.

Here is the top-view of the MIDI breakout board, an Arduino UNO processor board and a Sparkfun MIDI Shield. Click the image for higher resolution. You’ll want to take a closer look at the three boards in order to see the signal name associated with each header pin. (You can really zoom in if you download the image and load it into a paint program.)

midi_bob_uno_shield

The breakout board has a position for a MIDI THRU connector. This position is empty as the headers would block the opening of the 5-pin DIN connector. We don’t need the THRU port, so this isn’t a deal-breaker.

As I mentioned before, the long pins extending below the headers normally plug into a standard Arduino processor board (e.g., UNO or Leonardo). Each header pin effectively mirrors the electrical signals of the underlying Arduino board. So, in order to hookup to the littleBits Arduino, we just need to connect the appropriate Arduino board signals to the corresponding bitSnaps on the littleBits Arduino. That’s why you really want to zoom in and see the signal names. The board labels tell us where to plug in jumper wires.

We need four connections:

  • +5 Volts: Red wire
  • Ground: Black wire
  • RX (digital pin D0): Yellow wire
  • TX (digital pin D1): Blue wire

Our old high school shop teacher would yell at us if we didn’t use the right color wire for power, ground, etc. I will say, different wire colors make it easier to check and debug wiring!

So, how do we make connections to the littleBits Arduino? I used two littleBits proto modules: one proto module for the MIDI input side and one proto module for the MIDI output side. The other end of each jumper terminates in a screw connector on a proto module. Please see the image below. (Click to enlarge.)

sparkfun_midi_littlebits_arduino

RX is connected to RX, TX to TX, +5 Volts to +5 Volts, and Ground to Ground. The MIDI IN goes to the Arduino’s RX pin and the the Arduino’s TX pin goes to MIDI OUT.

You must configure the jumpers on each proto module. The MIDI OUT side is easy; just leave all three jumpers installed. One the MIDI IN side, remove the center jumper on the proto module. This breaks the connection from the proto board input to the proto board output. You must remove this jumper or the input signal will interfere with the incoming MIDI data.

Once all of the connections are made, you’ll need sketches to test the connections. Please see my article about testing an Arduino MIDI interface. The article describes a simple testing process. The article also has links to a simple MIDI sequencer sketch and the source code for a MIDI IN to MIDI OUT sketch. The MIDI sequencer sketch checks the MIDI OUT side. Once you know the MIDI OUT is good, then the MIDI IN to MIDI OUT sketch checks the MIDI IN side. (The sketch echoes MIDI IN to MIDI OUT.)

That’s it! You should now have your 5-pin MIDI equipment talking with the littleBits Arduino. If this project has bolstered your confidence with hardware — and I hope that it has — then please take a look at the DIY 5-pin MIDI interface project.

littleBits Arduino MIDI interface

I thought, “When it comes time to test the 5-pin MIDI interface with the littleBits Arduino, just hook it up. Download the sketches. Take a victory lap.”

Instead, I got an “opportunity” to discover and learn. Not so fast, but not so bad, either.

Please recall that a few posts ago I described the design of a 5-pin MIDI interface for Arduino. The MIDI IN part of the interface attaches to the Arduino RX pin (pin D0) and the MIDI OUT part connects to the TX pin (pin D1). I tested the 5-pin MIDI interface with an Arduino UNO board using the simple MIDI sequencer sketch and a sketch to echo MIDI IN to MIDI OUT. My original plan was to connect the 5-pin MIDI interface to the littleBits Arduino via two protoboards, then run the sketches, again, for testing.

First, the hook up. The image below shows the littleBits hardware. (Click the image for full resolution.) The Arduino is “at the heart” and communicates with a PC through the USB port. The littleBits proto module directly to the left of the USB port brings the logic-level MIDI IN signal to the Arduino RX pin. The proto module directly to the right of the USB port sends the Arduino TX signal to the MIDI OUT circuit. The signals to and from the 5-pin MIDI interface board are:

  • Yellow wire: Logic-level MIDI IN
  • Blue wire: Logic-level MIDI OUT
  • Red wire: +5 Volts (Vcc)
  • Black wire: Ground

MIDI is a serial communication standard operating at a rate of 31,250 bits per second. RX and TX are the Arduino’s digital serial receive and transmit pins, respectively.

littlebits_arduino_midi_interface

So far, so good. There are a few extra details to consider. The positive supply voltage (+5 Volts) and ground are distributed throughout the whole interface board. Only one set of power supply connections are needed to power the interface board. I attached the power supply connections to the proto module handing the MIDI OUT. Next, the proto module jumpers are configured a little bit differently on the MIDI IN and MIDI OUT sides. Having all three jumpers in place, the MIDI OUT proto module passes all signals: Vcc, ground and the data signal arriving from TX. The MIDI IN proto module only passes Vcc and ground. It does not pass the signal from its input bitSnap. The output from the proto module is generated by the signal coming from the 5-pin MIDI interface board (i.e., the yellow wire). This signal is send to the RX pin.

Adhering to my original test plan, I downloaded the simple MIDI sequencer sketch. This sketch tests the MIDI OUT circuit by sending MIDI note on and note off messages. I attached the MIDI OUT connector to a MIDI tone module, flipped the power switch, and no sound. MIDI data was not being sent to the MIDI tone module. After much wailing, gnashing of teeth and browsing, I remembered that the Arduino Leonardo board has two serial ports, not one port like the UNO. One serial interface handles RX/TX and another serial interface handles USB communications.

The littleBits Arduino is a Leonardo board. Was the MIDI data being sent to the USB port? I turned on the Serial Monitor in the IDE. Yep, the Serial Monitor was showing jibberish arriving from the Arduino. I expected jibberish because the bit rate was all wrong, but nonetheless, observations confirmed that MIDI data was going to the wrong port (USB instead of TX).

The Arduino IDE exposes two serial ports for a Leonardo board:

  • Serial” refers to the virtual serial port over USB.
  • Serial1” refers to the serial port through RX/TX.

Originally, I wrote and compiled the MIDI sequencer sketch for an Arduino UNO board. The calls to write() refered to Serial. That’s fine on the UNO because the UNO uses the same serial port for RX/TX and USB communication and everything works. On Leonardo (littleBits), however, the sketch refers to the USB serial port, not RX/TX as I had intended.

I solved the problem with conditional compilation. Here is the new code for the function MidiSend() in the MIDI sequencer sketch:

//
// Send a short, 3-byte MIDI message
//
void MidiSend(byte cmd, byte data1, byte data2)
{
#ifdef LEONARDO
  Serial1.write(cmd | CHANNEL) ;
  Serial1.write(data1) ; 
  Serial1.write(data2) ; 
#else
  Serial.write(cmd | CHANNEL) ;
  Serial.write(data1) ; 
  Serial.write(data2) ; 
#endif
}

The symbol “LEONARDO” determines the code to be compiled into the sketch. If LEONARDO is defined then the sketch sends MIDI bytes to Serial1. If LEONARDO is not defined, then the sketch sends MIDI bytes to Serial. I also needed to fix up the code in setup():

#ifdef LEONARDO
  Serial1.begin(31250) ;
#else
  Serial.begin(31250) ;
#endif

After making these changes and defining LEONARDO at the beginning of the sketch:

#define LEONARDO 1

I compiled and uploaded the sketch. Voila! I heard music from the tone module! MIDI data was now being sent to the appropriate Arduino serial port (TX).

Along the way, I also learned some useful information about the RX and TX LEDs. The RX and TX LEDs flash when data is transfered through the USB port. They do not flash when data is sent through the RX/TX pins. If you want to flash the LEDs yourself, then use the following macros:

    RXLED0;
    RXLED1;
    TXLED0;
    TXLED1;

These macros are a feature of the Leonard board and are not recognized on UNO.

Two separate, independent serial ports has its advantages. First, it isn’t necessary to disconnect the 5-pin MIDI interface board when uploading a sketch. With only one serial port on UNO, TX/RX and USB communication cannot peacefully co-exist. On Leonardo (littleBits), they do peacefully co-exist and you can use the virtual serial port over USB (i.e., Serial Monitor) to trace program execution and print debug messages while using RX/TX for MIDI communication. Finally, if we don’t ever touch Serial1, we should be able to configure D0 and D1 as regular Arduino digital input and output pins (respectively).

By now, you realize that I had to modify the sketch that echoes MIDI IN to MIDI OUT, too. Instead of conditional compilation, this sketches defines a symbolic constant, “SERIALPORT,” which expands to the name of the serial port to be read and written. Full disclosure: I did not test the MIDI library version on littleBits (Leonardo).

//
// Send MIDI IN to MIDI OUT (THRU)
//

// Author:  P.J. Drongowski
// Date:    6 June 2016
// Version: 1.1
//
// Copyright (c) 2016 Paul J. Drongowski
// Permission granted to use, copy and distribute

// Uncomment the following line to use the Arduino 
// MIDI library instead of serial read() and Write().
// #define USE_MIDI_LIBRARY 1
// This has not been tested/debugged on LEONARDO!

// Define the symbol SERIALPORT to select the appropriate
// serial port:
//    Serial    UNO
//    Serial1   LEONARDO/littleBits
#define SERIALPORT Serial1


#ifdef USE_MIDI_LIBRARY

#include <MIDI.h>
MIDI_CREATE_DEFAULT_INSTANCE() ;

void setup() {
  MIDI.begin(MIDI_CHANNEL_OMNI) ;
}

void loop() {
  if (MIDI.read())
  {
    MIDI.send(MIDI.getType(),
              MIDI.getData1(),
              MIDI.getData2(),
              MIDI.getChannel());
  }
}

#else

int midiByte = 0 ;

void setup() {
  // Initialize the serial port for MIDI
  SERIALPORT.begin(31250) ;
}

void loop() {
  if (SERIALPORT.available() > 0) {
    midiByte = SERIALPORT.read() ;
    SERIALPORT.write(midiByte) ;
  }
}
#endif

MIDI sequencer: Testing your MIDI interface

Now that you’ve assembled the MIDI interface for your Arduino, it’s time to try it out. That means you need a few basic sketches to test and debug the interface.

First, a philosophical word or two. Testing is one of the most neglected and least emphasized topics in engineering. Other than careful design, assembly and coding, nothing else is as important to the success of a project as testing. In practice, you should be thinking about testing while you design, code, layout and solder. Without getting too computer science-y, it all comes down to controllability and observability — the ability to apply a stimulus (test input) and the ability to measure and assess a response (expected vs. actual test output).

Take the case of our MIDI interface. There are two major subsystems: the MIDI IN circuit and the MIDI OUT circuit. We must drive the MIDI IN circuit with a keyboard (or some other device) that sends MIDI to the 5-pin MIDI IN connector. The Arduino reads the logic level bit-stream through its RX pin (pin D0). The messages in the bit-stream need to conform to the MIDI message standard. On the MIDI OUT side, the Arduino sends a logic level bit-stream into the MIDI OUT circuit via the TX pin (pin D1). Again, the bit-stream carries standard MIDI messages. We must observe the outgoing MIDI messages, perhaps by playing the MIDI stream into a MIDI-compatible keyboard or tone module.

In addition to controllability and observability, you also need a test plan that identifies the features to be tested and the order in which you intend to test those features. A carefully constructed plan can make your work more efficient and systematic. Again, taking the case of the MIDI interface, I intend to test the MIDI OUT side first because I can easily write a sketch to generate MIDI messages and that sketch does not require a working MIDI IN circuit. Once I know that the MIDI OUT is correct, I can use the MIDI OUT as part of MIDI IN testing. By testing MIDI OUT first, I can work around the limited controlability and observability of our system.

I hope this plan makes sense to you. Here’s a few additional points. We don’t need to test all MIDI standard messages and can restrict testing to simple 3-byte messages like NOTE ON and NOTE OFF. We need to have a reliable, known-good MIDI sender (like a keyboard or other controller) and MIDI receiver (like a tone module). I have two MIDI-compatible devices — a Roland SK-88 Pro Sound Canvas keyboard and a Boss DS-330 Dr. Synth module — that I like to use for testing. Both devices now have emeritus status, meaning that I won’t cry too much if I blow them up! I send the MIDI OUT from the Arduino to both devices and play the audio through self-powered speakers. I play the SK-88 keyboard and send MIDI NOTE ON and NOTE OFF messages to the MIDI IN circuit under test and read those messages on the Arduino.

With these preliminaries out of the way, let’s dive into the details.

MIDI OUT: Simple MIDI Sequencer

In order to test MIDI OUT, we need a sketch that sends MIDI NOTE ON and NOTE OFF messages via the TX pin into the MIDI OUT circuit. With a MIDI tone generator connected to the 5-pin MIDI OUT connector, we just need to listen to the audio from the tone generator to determine if the outgoing notes are correct.

I took the simple Arduino tone sequencer sketch and modified it to send MIDI NOTE ON and NOTE OFF messages. I replaced calls to the Arduino tone() function with code to send MIDI NOTE ON and NOTE OFF as appropriate. (Reusing code this way is known as “copy and modify.”) The new sketch is a simple MIDI sequencer that repeatedly plays back a musical sequence of notes through the MIDI OUT port. The sketch is a useful little program in itself — not just a specialized test.

Here are direct links to the source code for the sketch:

MidiNoteNum.h: Defines symbolic constants for the note names
ToneNote.h: Defines symbolic constands for note/rest durations
MidiSeq.ino: The simple MIDI sequencer Arduino sketch

The sketch does not use the Arduino MIDI library. It sends messages by making calls to the Arduino Serial library. I will use the Arduino MIDI library in future projects, especially when we need to parse complicated incoming messages.

The sketch sends messages on MIDI channel 1. So, be sure to have the destination tone generator configured to receive on channel 1 (or OMNI).

Here’s a possible gotcha that could drive you insane. The Arduino’s serial port is used for both uploading sketches and for MIDI communications. MIDI operates at a rather “unusual” data rate of 31,250 bits per second and most likely does not match the default rate established by the Arduino IDE. Even worse, the MIDI devices used for testing (i.e., keyboard controller) may be sending real time status messages that collide with commands from the IDE. Soooo, you may see messages about “sync” failure when uploading a sketch. If that is the case, then temporarily disconnect the MIDI IN circuit while uploading a sketch. Also, you will not be able to print to the serial port, etc. and see text serial messages in the IDE’s Serial Monitor window. Unfortunately, this limits the use of serial communication for tracing and debugging purposes when MIDI is connected and active.

MIDI IN: Echo MIDI IN to MIDI OUT

Once we know that the MIDI OUT port is working, it’s time to check the MIDI IN port. An easy way to test is to simply echo the incoming MIDI messages to the MIDI OUT port. If we have a MIDI keyboard connected to MIDI IN and a tone generator connected to MIDI OUT, then anything that we play on the keyboard should be heard through the tone generator. If the keyboard and tone generator are part of the same instrument (e.g., a synthesizer workstation, arranger or digital piano), be sure to turn LOCAL off. You want to hear the MIDI messages coming in through the instrument’s MIDI IN port.

Here is the code for the MIDI IN to MIDI OUT sketch.

//
// Send MIDI IN to MIDI OUT (THRU)
//

// Author:  P.J. Drongowski
// Date:    30 May 2016
// Version: 1.0
//
// Copyright (c) 2016 Paul J. Drongowski
// Permission granted to use, copy and distribute

// Uncomment the following line to use the Arduino 
// MIDI library instead of serial read() and Write().
// #define USE_MIDI_LIBRARY 1

#ifdef USE_MIDI_LIBRARY

#include <MIDI.h>
MIDI_CREATE_DEFAULT_INSTANCE() ;

void setup() {
  MIDI.begin(MIDI_CHANNEL_OMNI) ;
}

void loop() {
  if (MIDI.read())
  {
    MIDI.send(MIDI.getType(),
              MIDI.getData1(),
              MIDI.getData2(),
              MIDI.getChannel());
  }
}

#else

int midiByte = 0 ;

void setup() {
  // Initialize the serial port for MIDI
  Serial.begin(32500) ;
}

void loop() {
  if (Serial.available() > 0) {
    midiByte = Serial.read() ;
    Serial.write(midiByte) ;
  }
}
#endif

There are two ways to echo the incoming MIDI message stream. One way is to echo the bytes arriving on the serial input to the serial output. This is the most straightforward method. The other way is to use the Arduino MIDI library to read incoming MIDI messages and send the messages to the MIDI OUT port. The code (above) implements both methods and uses conditional compilation (#ifdef) to select and compile one of the methods. If you want to get your feet wet with the Arduino MIDI library, then define the symbol USE_MIDI_LIBRARY before the #ifdef.

Here are a few links for the Arduino MIDI library to help you get started.

Arduino MIDI Library site
Arduino MIDI Library Documentation
Deprecated site

The current version is 4.2. The Arduino IDE has a nice library management system: Sketch > Include Libraries > Manage Libraries.

5-pin MIDI IN/OUT for Arduino

I hope you enjoyed the last post about a simple tone-based sequencer for littleBits Arduino. My next goal is to make the littleBits Arduino fluent in MIDI. Then we can turn the littleBits Arduino into the heart of MIDI-based tools like real time controllers and synthesizers.

At the time of this writing, littleBits does not offer a 5-pin MIDI input module or a 5-pin MIDI output module. That shouldn’t stop us. With a little know-how and some soldering, it’s easy to whip up 5-pin MIDI IN and MIDI OUT circuits. I will show you how. Even though this discussion is in the context of littleBits Arduino, the circuits below will work with any Arduino. The circuits will even work with Raspberry Pi or Beaglebone for that matter! Once I get a couple littleBits proto modules, I’ll show you how to connect the MIDI interface circuits to the littleBits Arduino.

5-pin MIDI is a mature standard and is one of the most successful, long-running standards in personal computing. Most musicians are familier with MIDI cables and MIDI connections. MIDI cables have familiar 5-pin DIN connectors at either end. Wiring is symmetric. Unlike USB, there isn’t an A side and a B side. Connect a MIDI OUT to a MIDI IN and you’re good to go.

Even though a connector has five pins (and associated wires), only three pins are really involved in MIDI data communication. One of the three pins — “the one in the middle” — carries electrical ground. The other two pins form a current loop from the sender to the receiver and back to the sender. “Current loop” means that we are communicating 0’s and 1’s using the presence or absence of electrical current.

Everyday logic like CMOS or TTL digital circuits use voltage level to represent logical zero and logical one. Low voltage (nominally 0 Volts) represents logical zero and high voltage (nominally 5 Volts in a 5 Volt system) represents logical one. Digital circuits actually switch through a transition zone between 0 and 5 Volts. Logical 0 and 1 are defined by threshold voltages, and now we’re getting too far afield! You get the idea — the representations and electrical mode of operation are different.

Let’s start with the receiver (MIDI IN) because that’s where all of the interesting action takes place. Here is the schematic for a very basic MIDI IN. (Click on images to get full resolution.)

schematic_midi_in

The incoming current flows through a 220 ohm resistor into the optical side of a 6N138 optoisolator. That may sound scary, but Arduino folks already know how to blink an LED on and off. That’s what the current loop does. It blinks an LED in the optoisolator. The LED shines on a photodiode that controls two transistor switches. The transistors switch the output (pin 6 of the optoisolator) between logical 0 and logical 1 (in voltage-ese). Pin 6 is connected to the Arduino serial receive port (pin D0, also known as “RX”). That’s all there is to it!

The optoisolator isolates the sender and receiver electrically. This is a good thing in stage environments and any place rife with grounding problems, connection mistakes, etc. The resistor before the LED limits the current through the loop and into the LED. This resistor plus the 1N4148 diode provide input protection.

Here is the schematic for a basic MIDI OUT circuit.

schematic_midi_out

All the sender needs to do is to drive or remove an electrical current through the loop. When the loop is driven, the LED at the other end of the loop shines. When the current is removed, the LED turns off. The current loop is controlled by the Arduino send port (pin D1, also known as “TX”). The 220 ohm resistors are current limiting resistors that put a limit on the amount of current driven into the loop.

This MIDI OUT circuit gets the job, but is a little basic. Most practical commercial circuits use a driver (such as a CMOS 74HC125 buffer/driver IC) or a transistor switch. The driver provides a little more electrical assurance and protection on the sender’s side. Better to blow up an inexpensive driver IC than your Arduino!

I built both the MIDI IN and MIDI OUT circuits on an Adafruit Perma-Proto quarter-sized breadboard PCB. I like the layout of these boards and they have nice through-holes for soldering. They have the same layout as a quarter-sized solderless breadboard. In this case, you solder connections instead of inserting jumper wires and component leads into solderless breadboard holes. Please, note. If you want to use the circuits above, but are reluctant to solder, then by all means, use a solderless breadboard!

The following image shows the final result looking at the MIDI IN connector. Click the image for full resolution.

board_midi_in

The jumper wires sprouting from the board are not intended to make the board look like a court-jester. They are the connections to be made to the Arduino:

  • Red: +5 Volts
  • Black: Ground
  • Yellow: Connect to D0 / RX
  • Blue: Connect to D1 / TX

My construction style uses 2×1 and 2×2 headers to make external connections. The header pins mate up neatly with either Female/Female or Female/Male jumper wires. I used F/M jumpers in order to plug into the signal headers on a standard Arduino UNO for testing.

The next image shows the final resulting looking at the MIDI OUT connector.

board_midi_out

If you don’t mind soldering, but don’t want to go free-style on a prototyping board, then I recommend the Sparkfun MIDI Shield (DEV-12898). The latest revision of the MIDI Shield has good input protection and output drivers. It also has a RUN/PROG switch that is handy when uploading a sketch to the Arduino. MIDI and PC communications share the same serial port and conflicts must be avoided. (More about this issue in another post.) With the prototyping board, I just pull the yellow jumper wire when I upload a sketch.

The Sparkfun MIDI Shield has two knobs and three switches. This is a bonus if you are working with a standard Arduino. The knobs and switches go unused if you are working with a littleBits Arduino. In either case, the Sparkfun MIDI Shield is a viable alternative to “roll you own.”

Next time, I’ll describe the sketches that I wrote in order to test the MIDI IN and MIDI OUT.

Update: Use this simple MIDI sequencer sketch to test the MIDI OUT portion of the 5-pin interface.

littleBits Arduino tone sequencer

The littleBits Arduino module has the potential to be a MIDI-driven tone generator for a mono or paraphonic synthesizer. After getting the module, I was anxious to try it out even though I haven’t built a MIDI interface for it (yet).

Here is a picture of the littleBits hardware. (Click the image to get full resolution.) The Arduino module is in the middle between the controls at the left (button and dimmers) and the synth speaker at the right. The controls on the left hand side don’t do anything at the moment. I put a dimmer between the output pin (D5) and the synth speaker in order to control audio volume. It’s just more convenient to control the volume with a dimmer than the tiny trim pot on the synth speaker module. The knobs on the dimmers are my own touch; they aren’t standard-issue with the littleBits dimmers.

arduino_dimmer_speaker

To keep things simple, I wrote a sketch that implements a basic note sequencer. Each note has a pitch (frequency) and a duration (milliseconds). The notes are stored in an array. The Arduino loop() function steps through the array of notes and plays one note at a time. After the loop plays the last note in the array, it goes back to the beginning of the array. The loop has a delay() in it and the loop keeps track of the remaining duration of the currently playing note. The sketch calls the Arduino tone() function to play notes by sending a square wave at the desired frequency to output pin D5.

If you would like to learn more about this project, then read about the design of this simple Arduino-based sequencer and tone generator. Here are links to the source code:

ToneTest.ino: Main sketch
ToneFreq.h: Note frequencies
ToneNote.h: Note durations

The D5 and D9 output pins on the littleBits Arduino module have a switch that enables or disables low pass filtering. The “analog” switch position turns on the filtering. The “pwm” position turns filtering off. Should you build this project yourself, try both switch positions. The “pwm” position doesn’t filter the square wave and you will hear it loud and nasty. The “analog” position produces a quieter, mellower timbre thanks to the low pass filter. Be sure to try the littleBits synth filter, envelope and delay modules, too.

One more tidbit. Pictures of the littleBits envelope, filter and delay modules usually show the top-view. The picture below flips the modules over and shows the bottom-view.

envelope_filter_delay

From left to right, the modules are the envelope, filter and delay, respectively. There is some serious electronics on these boards! (Click the image for full resolution.) I hope to use these modules to mangle audio, not just synthesis.

All the best.

Update: 28 June 2016. If you enjoyed this project and have the littleBits Synth Kit, then check out an expanded version of the tone sequencer which drives the filter and envelope modules.

Tenor to the max!

A few posts ago, I deconstructed the Yamaha MOX (Motif XS) tenor saxophone patches. The article summarizes the waveform assignment and Expanded Articulation (XA) control for each element within a preset voice. I’m not going to dive into the basics here, so I recommend reviewing the article for background information on XA and its behavior.

The blog entry covered the MOX (Motif XS) tenor sax presets, but not the newer Motif XF (MOXF) presets. The XF series workstations have two additional waveforms:

  1. Tenor Sax2 Growl
  2. Tenor Sax2 Falls

bringing the XF up to the level of Tyros/PSR Super Articulation tenor sax voices. This article deconstructs the “Tenor MAX” preset which makes use of these additional waveforms. The analysis is relevant even in the Montage era because the Montage tenor sax is based upon the XF waveforms (no update in the new model).

Pushing the main topic aside for a moment, Super Articulation 2 (SArt2) voices are a whole different technology and even to this day, the Motif and Montage do not implement SArt2 voices. SArt2 seems to be a premium feature that is reserved for Tyros. SArt2 requires realtime analysis of playing gestures and computation which is beyond basic AWM2 synthesis.

The table below gives the waveform, key range, and velocity range for each element in the “Tenor MAX” patch.

    Elem#  Waveform            XA        Notes   Velocity
    -----  ------------------  --------  ------  --------
      1    Tenor Sax2 Soft     AllAFOff  C-2 G8    1   79
      2    Tenor Sax2 Med      AllAFOff  C-2 G8   80  110
      3    Tenor Sax2 Growl    AllAFOff  C-2 G8  126  127
      4    Tenor Sax2 Hard     AllAFOff  C-2 G8  111  125
      5    Tenor Sax2 Hard     AF2 On    C-2 G8    1  127
      6    Tenor Sax2 Falls    AF1 On    C-2 G8    1  127

When the AF1 and AF2 buttons are OFF, one of the first four waveforms are triggered based upon the key velocity. The four elements cover the dynamic range from soft, through medium, through hard, all the way up to growl. The AF1 and AF2 buttons select particular waveforms depending upon the player’s intention. When AF2 is ON, all key velocities trigger the hard waveform. When AF1 is ON, all key velocities trigger sax falls.

So, bottom line, the “Tenor MAX” programming is just about what I expected.

I hope the analysis of tenor sax programming has helped you to understand XA and Motif/MOX voice programming. If you’re a Tyros/PSR player, then I hope that this analysis has helped you to understand a little bit of the technology beneath the Super Articulation voices.

Montage review: Yes, I’ve played one!

The Yamaha Montage synthesizer is now hitting stores in North America. One of the local retailers (GC in Natick) have a Montage set up for demo. Let’s go!

The demo unit is a Montage8 with the 88-key balanced hammer effect keyboard. I have always liked Yamaha’s upper-end “piano” actions and the Montage8 is no exception. I primarily play lighter “synth” action keyboards like the MOX and the PSR-S950. Fortunately, I spent the previous week working out on the Nord Elecro 2 waterfall keyboard, which requires a slightly heavier touch. I played the Montage8 for a little bit more than an hour without my hands wilting — a good sign.

First off, the demo unit was plugged into two Yamaha HS7 monitors and a Yamaha HS8S subwoofer. GC usually patches keyboards through grotty keyboard amplifiers, so I suspect that Yamaha provided the monitors in order to create the best impression of the Montage. I was dismayed when I started off with a few B-3 organ patches and could not contain the low end. The front panel EQ simply didn’t do the job. Time to check the monitor settings. The HS7s were flat, but the HS8S subwoofer level was cranked. After backing off the sub, all was right with the world.

Yes, some people like to simulate small earthquakes with subsonic frequencies. This, however, is not conducive for acoustic music. It’s not conducive for peaceful co-existence with your bass player either. If you encounter a Montage in the wild, check the EQ before proceeding!

So, as you may have gathered already, this is not a review of Montage for EDM. I took along my church audition folder (covering gospel to contemporary Christian to traditional and semi-classical music) and a small binder of rock, jazz, soul and everything in between. I’d like to think that this is the first time anyone has played “Jesu, Joy of Man’s Desiring” on the Montage, however poorly.

The electric pianos are terrific. I had a fine old time playing soul jazz and what not. Great connection between keys and sound. Comparing against Nord Stage, I would say that the Montage is top notch in this department and definitely a cut above the old Nord Electro 2. Yamaha did not put the Reface CP (Spectral Component Modeling) technology into Montage; they didn’t need to.

Tonewheel organ is still Yamaha’s Achilles’ heel. There is some modest improvement, but the Montage is not in clone territory. In this area, I would say, “Advantage Nord.” If I can cover B-3 with the MOX on Sunday, I’m sure that the Montage is up for medium duty. However, the tonewheel organs lack the visceral thrill of the EPs. I will say that the 88-key action did not inhibit my playing style too much. (If I was going to buy a Montage, tho’, it would be a 6.)

The pipe organs got some tweaks, mainly by enhancing the Motif pipe organ sounds via FM. There are a few lovely patches, but I will still look to the Tyros (and the PSR expansion pack) for true realism. The Nord Electro 5d has modeled principal organ pipes where the drawbars change the registration. Ummm, here, I would give the edge to Nord. Plus, the pipe organs in the Nord sample library are more on par with the Tyros and PSR expansion pack. Hate to say it: Montage pipe organs are good “synthesizer pipe organs,” and that ain’t entirely a compliment.

The new strings are wonderfully realistic, especially for solo/melody lines. I really enjoyed bringing sections in and out dynamically. (The expression pedal was sync’ed to the SuperKnob.) With the changes in our music ministry group, I’ve been playing more melodic and exposed parts. I could really dig playing a reflective improvisation for meditation using the strings and woodwinds under Motion Control.

The classical woodwinds got a boost in Montage, too. The woodwinds are all excellent although the sonic delta above Motif XF (MOXF and MOX, too) was not as “Wow” as the strings. Most likely, my ears were getting tired at that point…

Since I was losing objectivity, I just briefly touched on brass. I need good French horns and Montage did not disappoint. I wish that I had spent time with the solo trumpets and trombones, but my ears were telling me to knock it off.

The new Telecaster (TC) is quite a treat. The “Real Distortion” effects (Motif XF update 1.50) are now standard and the programmers made good use of them. I wish that the Montage had the voice INFO screen from the PSR/Tyros series. The INFO screen displays playing tips and articulations for each voice. This makes it a lot easier to find and exploit the sonic “Easter eggs” in the patches. (“Play AF1 to get a slide. Play AF2 to get a hammer on.”)

Fortunately, it was a rainy Saturday afternoon and the store was empty — disturbed only by the occasional uncontrolled rugrat pounding on some poor defenseless keyboard. Overall, I felt like I really heard the Montage and could make a fair evaluation.

I did not dive into editing, arpeggios, motion sequencing, recording, etc., so this is surely not a comprehensive review. Anyone spending less than one month with this ax cannot claim “comprehensive.” It just ain’t possible, so I would call my initial opinion, “first impressions.” That said, I can see why the Live Sets are important. I mainly dove in through Category Search where some of the touch buttons are a wee too small. Punching up a sound in full combat requires BIG buttons.

Montage looks, feels and sounds like a luxury good. Montage is also priced like a luxury good. The Montage8 MAP is $4000 USD. It is quite a beast physically and I would most likely go for the Montage6 at a “mere” 33 pounds and $3000 USD. None of the Montage line would be an easy schlep, especially when I have to buzz in and out of my church gig fast.

Would I buy one? Tough call. On the same field trip, I got to sit in a Tesla Model S ($71,000 USD) — a luxury car built around a computer monitor or two. I just recently bought a Scion iM (AKA Toyota Auris, Levin, Blade, whatever) for about $20,000 USD. Both cars could get me to the gym and back. I like my iM. What does that say about me as a customer? Do you think I would buy a Montage? Enigmatic.

See the list of new waveforms in the Montage. Also, check out the latest blog posts! Update: May 10, 2016.

Explicit Sax

Hope you got your Motif XF. The current stock is gone, gone, gone.

Comparing waveforms (Montage vs. XF) got me interested in the tenor sax samples and voices. The Yamaha MOX has the basic tenor sax samples (Med, Hard, Growl) while the Motif XF rounds out the set with Soft dynamic samples and falls. The XF (and MOXF) showcase the tenor sax in the “Tenor Max” preset voice.

Since I was curious to discover “what I’m missing,” I deconstructed four tenor sax patches on the MOX. Also, I compared the MOX voices against the Super Articulation tenor sax voices on the PSR-S950 arranger workstation in a listening test. The A/B test was enlightening as the MOX and S950 use the same waveforms — at least to my aging ears! The S950 triggers the samples using Super Articulation (SA) rules while the MOX triggers the samples using Expanded Articulation (XA) rules. Rules aside, you get to the same sonic place.

With XA, there are three main ways that samples are selected and triggered:

  1. Normal: Triggered when keys are played in the regular way.
  2. Legato: Triggered when Mono/Poly mode is Mono and keys are played in a legato manner, i.e. one or more keys are held while a new key is struck.
  3. AF1 and AF2: Triggered when either AF1 is ON, AF2 is ON or AF1/AF2 are both OFF and a key is struck. (The switch states are exclusive.)

See the Yamaha Synthesizer Paramater Manual for all the gory details. XA and SA differ in the amount of automated decision making made by the control software. SA is more automated and XA is more manual, giving the player more explicit control over articulations.

First up is the PRE5:008(A08)Tenor Dynamic AF1 voice. The AF1 and AF2 buttons are assigned in the following way:

    AF1: Mono/Poly mode
    AF2: FEG-D1

The AF1 and AF2 buttons do not affect sample selection in this voice other than putting the keyboard into Mono mode or Poly mode. Thanks to this simplification, it’s a good place to start ‘splaining.

The table below gives the waveform, key range, velocity range and volume level for each element in the patch.

    Elem#  Waveform            XA      Notes   Veloc  Level
    -----  ------------------  ------  ------  ------ -----
      1    Tenor Sax2 Med      Normal  C-2 G8  1   60   110
      2    Tenor Sax2 Med      Normal  C-2 G8  61  90   110
      3    Tenor Sax2 Med Of   Legato  C-2 G8  1   90    86
      4    Tenor Sax2 Hard     Normal  C-2 G8  91 127   120
      5    Tenor Sax2 Hard Of  Legato  C-2 G8  91 127    95
      6    Small Tabla Dom     Legato  C4  G8  1  127    52
      7    Small Tabla Dom     Legato  C-2 B3  1  127    78
      8    Sine                Legato  C-2 G8  1  127    78

The element levels are programmed to even out the perceived loudness across waveforms. Of course, there are many parameters for each element beyond what is shown in the table. For example, each dynamic level (velocity range) has its own filter and amplitude characteristics. There may even by a little velocity-sensitive pitch scoop at the beginning of a note!

The tenor sax waveforms (elements 1 to 5) cover the entire key range: C-2 to G8. The waveforms are assigned to different velocity ranges and are selected (and triggered) depending upon Normal or Legato playing gestures. The first element is triggered when a Normal (detached) gesture is detected and the key velocity (i.e., how hard the key is struck) is between 1 and 60 inclusive. The second element is triggered under the same conditions except the key velocity is between 61 and 90 inclusive. The AF1 button toggles between Mono and Poly mode — whether a legato gesture triggers a Legato element or Normal element.

You can see that only one of the first 5 elements is triggered at a time depending upon the combination of gesture, note range and velocity range. The Tenor Sax2 Med waveforms are played for quieter dynamic levels and the Tenor Sax2 Hard waveforms are played for the louder dynamic levels.

The Tenor Sax2 Med Of and Tenor Sax2 Hard Of waveforms are triggered by a Legato playing gesture. The “Of” in the waveform name means “Offset” and sample playback starts later in the waveform data, that is, skipping the attack part of the waveform. This eliminates the initial attack which is characteric of a sax playing detached notes.

Elements 6 to 8 are triggered only for Legato notes. These elements add a low-level “pop” at the beginning of each note. Think of this sound as a “connective tone” between notes. Tyros’s Super Articulation 2 technology (also known as “Articulated Element Modeling”) blends actual connective tones between notes, producing realistic articulations. The blending requires considerably more samples and processing power than the MOX or the S950.

The PRE5:009(A09) Tenor Soft Legato voice is a simplified version of the first patch. AF1 selects Mono and Poly modes. (AF2 is unassigned.) The patches use only the “Med” waveforms to achieve an overall softer timbre.

    Elem#  Waveform            XA      Notes   Veloc  Level
    -----  ------------------  ------  ------  ------ -----
      1    Tenor Sax2 Med      Normal  C-2 G8  1   70   110
      2    Tenor Sax2 Med Of   Legato  C-2 G8  1   80    99
      3    Tenor Sax2 Med      Normal  C-2 G8  71 127   110
      4    Tenor Sax2 Med Of   Legato  C-2 G8  81 127    99
      6    Small Tabla Dom     Legato  C4  G8  1  127    46
      7    Small Tabla Dom     Legato  C-2 B3  1  127    75
      8    Sine                Legato  C-2 G8  1  127    59

There are two dynamic levels (lower and higher velocity ranges) and two playing gestures (Normal and Legato) forming four combinations of dynamic level and gesture. Elements 6 to 8 implement a connective tone as previously described.

Life gets more interesting in the PRE5:0010(A10) Velo Growl Legato patch. AF1, again, selects Mono and Poly modes. (AF2 is unassigned.)

    Elem#  Waveform            XA      Notes   Veloc   Level
    -----  ------------------  ------  ------  ------- -----
      1    Tenor Sax2 Hard     Normal  C-2 G8  1    60   119
      2    Tenor Sax2 Med Of   Legato  C-2 G8  1    60    86
      3    Tenor Sax2 Growl    Normal  C-2 G8  61  127   125
      4    Tenor Sax2 Hard Of  Legato  C-2 G8  61  100   102
      5    Tenor Sax2 Growl Of Legato  C-2 G8  101 127    94
      6    Small Tabla Dom     Legato  C4  G8  1   127    52
      7    Small Tabla Dom     Legato  C-2 B3  1   127    78
      8    Sine                Legato  C-2 G8  1   127    78

There are roughly three dynamic levels:

  • Velocity 1 to 60: A hard attack is triggered for Normal notes and a soft attack, medium sax is triggered for Legato notes.
  • Velocity 61 to 100: A growl sax is triggered for Normal notes (up to velocity 127) and a soft attack, hard sax is triggered for Legato notes.
  • Velocity 101 to 127: A soft attack, growl sax is triggered for Legato notes.

This programming allows interesting one-hand control. Play soft to get a pure sax tone and play hard to get a growl. Play detached to get a harder attack and play legato to get a softer note attack (when Mono mode is selected via AF1).

The fourth and final patch is PRE5:011(A11) Tenor Growl AF1. The buttons are assigned in the following way:

    AF1: Mono/Poly mode and growl waveform
    AF2: Tenor Sax1 waveform

As you’ll see in the table below, the AF2 button selects the original Motif Tenor Sax1 waveform.

We again have two dynamic levels triggered by velocity ranges 1 to 100 and 101 to 127. Here, the assignable function buttons really come into play.

    Elem#  Waveform            XA        Notes   Veloc   Level
    -----  ------------------  --------  ------  ------- -----
      1    Tenor Sax2 Med      AllAFOff  C-2 G8  1   100   120
      2    Tenor Sax2 Hard     AllAFOff  C-2 G8  101 127   125
      3    Tenor Sax2 Growl    AF1 On    C-2 G8  1   127   127
      4    Tenor Sax2 Hard Of  Legato    C-2 G8  101 127   102
      5    Tenor Sax2 Hard Of  Legato    C-2 G8  1   100   102
      6    Tenor Sax1          AF2 On    C-2 G8  1   127   119

AF1 brings in a growl waveform (element 3) when it is turned ON. AF2 brings in an entirely different tenor sax waveform and tone (element 6) when it is turned ON. The first two elements play a pure tenor sax tone when all AF buttons are OFF. Elements 4 and 5 play a hard sax tone with a softer attack for legato playing gestures. You would be hard pressed to think about these combinations when actually playing — you just have to “go for it” intuitively, knowing that AF1 kicks in the growl.

Turning OFF AF1 while holding the key cuts off the note. Whether this is a bug or a feature is your’s to decide!

The effect programming in these four presets is not very adventurous. The effects are appropriate for a laid-back, mellow sound. Here’s a quick breakdown:

    Preset voice        Insert A   FX preset    Insert B    Dry/Wet
    -----------------  ----------  ---------  ------------  -------
    Tenor Dynamic AF1  VCM EQ 501    Flat     TempoCrosDly   D63>W
    Tenor Soft Legato  VCM EQ 501    Flat     TempoCrosDly   D59>W
    Velo Growl Legato  VCM EQ 501    Flat     TempoCrosDly   D54>W
    Tenor Growl AF1    VCM EQ 501    Flat     TempoCrosDly   D63>W

The Insert A effect is the VCM multi-band EQ. The EQ curve is flat, so the EQ is not coloring the sound at all. The Insert B effect is a tempo cross delay. The dry/wet mix is set conservatively (D54>W) or just plain off (D63>W). The system CHORUS effect is not applied and the system REVERB is a nice REV-X reverb.

The effect programming on the PSR-S950 is a little more exciting and adds a grittier sound for rock and R&B. The RockSax voice employs a distortion plus delay effect algorithm:

    PSR effect: DISTORTION+ > DST+DELAY1

    Parameter       Value
    --------------  --------
    LCH Delay       250.0 ms
    RCH Delay       300.0 ms
    Delay FB Time   375.0 ms
    Delay FB Level  +16
    Delay Mix       50
    Dist Drive      10
    Dist Output     110
    Dist EQ Low     +3 dB
    Dist EQ Mid     +1 dB
    Dry/Wet         D40>W

Transporting this effect to the MOX, you could assign AMP SIMULATOR 2 to insert A. For insert B, you could stick with the tempo cross delay or you could program a fixed delay instead (e.g., DELAY L,R (STEREO)) using the parameters above. A third possibility is to use the MOX’s COMP DISTORTION DELAY algorithm which combines the distortion and delay into a single effect block.

The S950 GrowlSax voice uses a different distortion plus delay algorithm:

    PSR effect: DISTORTION+ > V_DST S+DLY

    Parameter       Value
    --------------  --------
    Overdrive       14%
    Device          Dist2
    Speaker         Combo
    Presence        6
    Output Level    98%
    Delay Time L    250.0 ms
    Delay Time R    250.0 ms
    Delay FB Time   500.0 ms
    Delay FB Level  +12
    Dry/Wet         D32>W
    Delay Mix       44
    FB High Dump    1.0

Programming options are similar. Set MOX insert A to AMP SIMULATOR 1 and either stay with the tempo cross delay for insert B, or set insert B to a fixed delay algorithm. Or, run everything through the MOX’s COMP DISTORTION DELAY algorithm. Tune the Dry/Wet mix to taste.

Hey, here’s a bonus — the effects for the S950 slapback guitar. This might sound good with a sax, too.

    PSR effect: DISTORTION > V_DIST ROCA

    Parameter       Value
    --------------  --------
    Overdrive       20%
    Device          Vintage
    Speaker         Twin
    Presence        14
    Output Level    66%
    Delay Time      16th/3
    Delay FB Level  +3
    L/R Diffusion   +10ms
    Lag             +0ms
    Dry/Wet         D<W63
    Delay Mix       127
    FB High Dump    1.0

In this case, go with AMP SIMULATOR 1 for MOX insert A. Use either the tempo cross delay for insert B or change insert B to the TEMPO DELAY STEREO algorithm.

Even though I’ve discussed voice and effects programming in the context of the MOX, these techniques all apply to the Motif XS, XF and MOXF, too.

If you would like to know more about Super Articulation voices, then please check out: SA and SA2: Is Motif up to the task? I also saved two informative posts from the Motifator forum about Super Articulation and Expanded Articulation.

Read about Motif XF (MOXF) “Tenor MAX” voice programming. Update: 18 May 2016.

Montage: New waveforms

Well, well. Interesting times, again. Yamaha have now released the Montage Reference Manual and the Data List Manual. Download them from your local support site.

At the same time, the Motif XF is being blown out. Not only have retailers dropped prices, Yamaha itself is saying “Sayonara” with a promotional rebate of its own. If you want a Motif XF, now is a terrific time to buy!

I started the decision making process last weekend by comparing the MOX waveforms against the Motif XF waveforms. To me, new waveforms represent true value — true sonic potential — over a keyboard’s predecessor. Unless MOXF owners want all of the bells and whistles of the Motif XF (e.g., big color display, on-borad sampling, sliders, version 1.5 Real Distortion effects, etc.), they already have the XF waveforms. MOX owners have the older Motif XS factory set, so they might be interested in upgrading to Motif XF. Here is a list of Motif XF waveforms that are not in the MOX:

    CF3 4 layer (vs. MOX 3 layer)
    S6
    Clav4
    Harpsichord2
    Farfisa (Fr)
    Vox (Vx)
    Accordion2
    Accordion3
    Tango Accordian2
    Mussete Accordion
    Steirisch Accordion
    1Coil
    Jazz Guitar
    Pick Rndwound2
    Pick FlatWound
    Finger Rndwound
    Sect Strngs
    Tremolo Strings
    Live Pizzct
    Soft Trumpet
    Trumpet Vib
    Trumpet Shake
    Flugelhorn2
    French Horn Sft
    French Horn Med
    Soprano Sax3
    Alto Sax3
    Tenor Sax2 Soft
    Tenor Sax2 Falls
    Sax Breath
    Piccolo2

After looking over the list, frankly, I’m not motivated (bad pun) to buy an XF. My PSR-S950 does a great job covering these sounds. Plus, at 33.3 pounds (XF) vs. 15.4 pounds (MOX), a Motif XF is likely to remain in the studio, not at the gig.

The Yamaha Montage offers a bigger upgrade thanks to the large built-in waveform memory. Here is my first pass list of new Montage waveforms. I’ll leave it to you to comb through synth and percussion waveforms.

    CFX 9 layer
    S700 3 layer
    EP4 5 layer
    Rd Soft 5 layer
    Rd Hard 4 layer
    Rd73 5 layer
    Rd78 5 layer
    Rd KeyNoise
    Wr1 3 layer
    Wr2 4 layer
    Wr3 5 layer
    Wr KeyNoise
    Clav5 3 layer
    Clav KeyNoise
    CP80 5 layer
    CP80 KeyOff
    Vibraphone3
    Motor Vibes
    Tonewheel1 Fast/Slow
    Tonewheel2 Fast/Slow
    Tonewheel3 Fast/Slow St
    Tonewheel4 Fast
    Tonewheel5 Fast
    Tonewheel6 Fast
    SctAcc Mussete
    SctAcc
    Acc Key On/Off
    Nylon2
    Flamenco
    Steel2
    Steel3
    TC Cln Pick
    TC Cln Fing
    Acoustic2 (bass)
    Violin2 1st St
    Violin2 2nd St
    Viola2 St
    Cello2 St
    Celtic Violin
    US Strings
    Violins 1st
    Violins 2nd
    Violas
    Cellos
    ContBasses
    CelticHarp
    Trumpet 3
    Piccolo Tp
    Trombone 3
    Bass Trombone
    French Horn2
    Euphonium
    BrassSect3
    BrassSect3 Acc/Doits/Shake/Falls
    Trumpets1
    Trumpets2
    Trombones1
    Trombones2
    FrHorns2
    FrHorns3
    Clarinet2
    Clarinet3
    Oboe3
    Oboe4 NV/Stac
    Bassoon2
    Bassoon3
    Flute3
    Flute4 NV/Stac/Flutter
    Piccolo3
    Piccolo4 NV/Stac
    Low Whistle
    High Whistle
    Boys Choir
    Gospel Choir
    Syllables
    ScatCycle
    LatinCycle

Yamaha really upped the ante with new acoustic and electric piano samples. Yamaha have been promoting these improvements and rightfully so. I can’t wait to try these out. Jazzers will be glad to see the new vibraphone samples, too.

Tonewheel organ got a modest upgrade. I’ll reserve judgement until I can hear and play the Montage. The tonewheel samples have fast and slow variants, so the Leslie is probably sampled in. Not always a good sign, but, hey, I’m listening. A couple of more accordions round out the keyboard additions.

Guitars also got a modest upgrade. There are a few more acoustic guitars and two Telecaster variants (pick and finger). At this point, I must mention that all of the new waveforms have 3, 4, 5 or more layers and many articulations. So, even if the list looks short, the new voices should be quite rich and appealing.

Orchestral instruments got a major, major upgrade. As a liturgical musician who relies on these voices heavily, I’m excited. I called out only a few of the available articulations. Musicians who mock up orchestral scores or cover orchestral parts live should definitely take note of the Montage! Surprisingly, there aren’t new pipe organ waveforms. (Is an expansion pack in the works?)

Finally, there are a slew of choir and vocal samples from the Tyros 5. “Syllables” in the list above are all of the zillion duhs, doos, etc. ScatCycle includes the (infamous) scat syllables, but cycles through the syllables for variety. This is already a feature of the Tyros 5.

Given the boost in the orchestra department, I’m interested. I just wish that the Montage weighed about 20 pounds or less. Perhaps I need to wait for the MOXF follow-on in the light weight, mid-price category.

That’s it for now. I might have missed something during the first pass and will correct the list as I learn more about the Montage. At some point, I’ll take a look at Montage effects, too.

Read my initial review of the Montage8. Update: May 10, 2016.

All site content is Copyright © Paul J. Drongowski unless indicated otherwise.