Monday, December 8, 2014

Basic audio engineering - USB-MIDI cable, y adapter, stereo/mono/TRS/TS understanding

Background

I had decided to purchase a USB-MIDI cable online, and I was delighted to find a cheap one costing < $5.00: http://www.amazon.com/gp/product/B001LJUVO4/ref=oh_aui_detailpage_o00_s00?ie=UTF8&psc=1. When it came, no setup was required other than plugging it in. It seemed to work well, transmitting notes from my keyboard (a Yamaha P95-B) to GarageBand. 

But the problem came when I depressed the pedal: The software did sustain properly, but it also registered a blatant E note. The E note is unacceptable for me because I use the pedal often when I play piano, and it completely interferes with whatever I'm playing.

Consequently, I searched online for a solution. It seemed many people had had this issue: "Pedal plays an E???" (Apple discussion thread). Unfortunately, there was no clear answer. When I search for solutions online, I try to find multiple sources that describe the same answer - not only to get multiple perspectives for more information, but also for higher confidence in the solution.

Some people in stores suggest the problem is on the software's side, or the keyboard's side, or the pedal's side. This is possible, but in this specific case of the pedal playing an E note but also doing the sustain properly, I have found the issue to be in the specific cable. 

One answer in the Apple discussion at https://discussions.apple.com/thread/3122897?tstart=0 describes that the cable is the problem, too:
Well, my problem has been solved.

I coughed up AUD$49 and bought a branded USB-to-MIDI cable and the sustain problem has disappeared.
But there's no explanation for why a more expensive MIDI-USB cable might solve the issue for people in general. So I called Yamaha to ask about the keyboard, and see if it was truly the keyboard's problem or the cable or something else. This is what I learned:

Solution

Basically, there are 2 kinds of MIDI cables: "class compliant" and "proprietary." Class compliant are the cheaper ones, typically $3-15. These can work for basic use, but they lack support for the appropriate drivers, so they may behave erratically, playing arbitrary notes or not registering sounds at all. Proprietary ones are more expensive, usually >$40. These support the appropriate drivers.

To set up proprietary MIDI cables, you must ensure your computer has the proper drivers; if not, go through an install process to obtain them. For Mac, that amounts to simply downloading the right driver from this site: http://download.yamaha.com/search/detail/?site=usa.yamaha.com&language=en&category_id1=16277&category_id2=16279&category_id3=16298&product_id=107905&asset_file_language=EN&asset_id=57163. He said that the "UX16 USB MIDI driver" would work for me.

In summary, the problem was that the cheap cable that I had ordered lacked the proper driver support to interpret the pedal properly. According to the Yamaha support person, proprietary MIDI cables have proper support for these drivers, so buying a proprietary MIDI cable, which is more expensive, and then downloading the right driver on your computer is likely to solve the issue.

Why get a MIDI-USB cable to begin with?

My friend on the phone was of the talkative type, and he went into much more detail than I had anticipated. I'm grateful he did so because he actually helped me solve a bigger issue in my plan to record better music with my keyboard.

The whole reason I wanted a MIDI-USB cable was to record my keyboard playing more precisely. However, MIDI-USB cables don't transmit sound; they just play an existing sound on the computer in the GarageBand or Logic Pro library. The quality of the sound file may be better depending on the library of sounds available, so Logic Pro's library may sound better than GarageBand's library. But the point is that since no sound is transmitted through the cable, the nuances in piano playing are lost - you know, that expressive musician stuff. Granted, MIDI provides lots of benefits. The notes are editable in digital audio workstations (DAW) like Logic Pro, and you can change the instruments easily after recording. But for me, the nuances of music are more valuable, and I intend to record songs in one go and with minimal editing with a DAW anyway.


Understanding terminology

After explaining that I have a Scarlett 2i2 interface by Focusrite (http://us.focusrite.com/usb-audio-interfaces/scarlett-2i2), which accepts 2 inputs, he gave me this recommendation:

To keep nuances of the keyboard, I should get a Y-cable. Specifically: "a Y adapter/cable with a stereo miniature male on one side and a mono 1/4 inch male on the other side." I didn't know how to interpret this initially, but after asking around and reading, it's not so difficult.
  • male refers to the pointed end of a cable; female refers to the hole/receiving end of the cable.
  • 3.5mm (about 1/8 inch) is the common size for plugs into laptops and mp3 players. Think Apple earbuds or the typical headphone jack of a laptop - that's 3.5mm. 1/4 inch is the larger size for lots of audio equipment.
    • So, by "miniature" he probably meant 3.5mm (1/8 inch), since 1/4 inch is probably the standard among audio engineering.
    • I had told him I had a way to connect my regular headphones to my keyboard, so this is probably why he said "miniature". But my method requires using a converter from a 3.5mm female (F) to a 1/4 inch male (M). So, getting a 1/4 inch on both sides for the cable works better because then I don't have to use the converter.
  • There are two types of sound systems: mono and stereo. 
    • From http://www.diffen.com/difference/Mono_vs_Stereo:
      • Stereo (or Stereophonic sound) is the reproduction of sound using two or more independent audio channels in a way that creates the impression of sound heard from various directions, as in natural hearing. 
      • Mono (Monaural or monophonic sound reproduction) has audio in a single channel.
    • Since stereo reproduces sound in 2 independent channels, it makes sense that the y-adapter splits off - the end with one part is the stereo side, and the end with two parts is the mono side.
    • You can differentiate Stereo and Mono by looking at the number of stripes on the metal part. The stripes are insulation; the metal contact bands are the channels, with one extra for ground. So 2 metal bands means mono, and 3 metal bands means stereo. This explains those TS/TRS abbreviations we see on lots of cables/converters.
      • TRS = tip ring sleeve = names of 3 metal parts = stereo
      • TS = tip sleeve = names of 2 metal parts = mono
Finally, this is the cable I ended up ordering: http://www.amazon.com/Hosa-Cable-STP203-Dual-Insert/dp/B000068O1P/ref=cm_cr_pr_product_top/190-6296940-4917419. You can see the metal bands right in the picture.


The 1/4 inch stereo side fits into my Yamaha P95-B's headphone jack, and the two 1/4 inch mono sides fit into my Scarlett 2i2 interface's two inputs. They work great.

Diagram of how to connect


(Scarlett 2i2 Interface here)
Mono 1/4 inch male 
Input 1 Input 2 - make sure to switch both to *Line input mode!* 
\                 / 
 \               / 
   ---------- 
          | 
Stereo miniature male 
(Keyboard here)

Then I can put headphones into the Scarlett and listen to myself play as I record.