tech log on gentoo, linux, and random stuff

Exporting Yamaha YPG-635 recorded songs to wav via AV-710 Line-in jack

leave a comment »

I recently bought myself a Yamaha YPG-635 digital piano. It saves
recordings internally as SMF (Standard Midi Format) files. While
that’s good if you want to do some further midi sequencing, I don’t
yet feel the urge to properly set up a linux midi workstation just to
share some of my amateurish playings with family and friends–a quick
way to export them to wav files would be enough. The built-in speaker
of this DP is crappy, but the headphone out is pretty decent (I’m
using a pair of Sennheiser HD650 cans), so it seems natural to feed it
into the soundcard’s Line-in jack.

Turns out it’s not a simple matter of “plug and record”, so here’s a
mini-Howto. I’m using a Chaintech AV-710 soundcard (already
discontinued for some time now, but among other things has a pretty
decent wolfson DAC on the alt-out jack).

1 Sound card settings:

I’m talking about the settings you can tweak in alsamixer

  1. Playback. Go to the playback tab in alsamixer. To reproduce the
    line-in signal on the wolfson output (the black jack right next
    to the actual S/PDIF jack), set “S/PDIF” from PCM to “H/W In 0”,
    and “S/PDIF 1” to “H/W In 1”. These correspond to the left/right
    channel of the line-in signal (so you get stereo!)

    NB: I didn’t try to reproduce it on the “front out” jack (which
    nobody using AV-710 would use!). The “S/PDIF” and “S/PDIF 1” are
    probably referring to the wolfson device. (“S/PDIF 0” is probably
    the actual S/PDIF jack)

  2. Capture. Go to the capture tab in alsamixer. Press space on the
    “Line” device. There are multiple capture devices on this card
    and they seem mutually exclusive (i.e., pressing space on e.g.
    “Mic” would activate “Mic” and deactivate “Line”).

    Since the DP jack is really a headphone out, better set the
    “Capture” gain to zero–no good can come out of double amping!

2 Recording command:

arecord -D plughw:0,0 -f cd -t wav cavatina.wav

Now hit the Play button on your DP. The song (Cavatina in this case.
Beautiful piece by Stanley Myers btw.) will be recorded to
cavatina.wav as you hear it from your wolfson out. Notice that
plughw is necessary b/c natural format of AV-710 is S32LE instead
of the 16bit cd format (S16LE). The “plughw” ALSA plugin will do
the format converting job.

3 Combining audio with video:

mencoder cavatina.avi -audiofile cavatina.wav -delay -0.55 -oac copy -ovc copy -o cavatina-song5-track4-audio.avi

Written by zsh

June 14, 2010 at 8:32 pm

Posted in /usr/bin

Tagged with , , , , , ,

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: