jack-keyboard

jack-keyboard is a program that provides the function of a MIDI hardware keyboard. I don’t recommend it (or any virtual keyboard) for real-time playing but it can be useful for testing and for holding a note while tuning. I tested jack-keyboard version 2.7.1.

jack-keyboard-01
I like the “sustain” feature, which works like a sustain pedal. I press and hold the space bar and then click the desired note. I then release the space bar. To stop the note, I either press and release the space bar a second time, click the Sustain button, or click the note again.

It’s also possible to produce notes via the computer keyboard.

For more information about jack-keyboard, see its man page or the documentation at its web site: http://jack-keyboard.sourceforge.net/

UPDATE 28 JULY 2015: Pressing the Escape key is a “MIDI Panic” button (that presumably sends All Notes Off).

Other Virtual Keyboards

It appears that vmpk (Virtual MIDI Piano Keyboard) may be the most popular virtual keyboard program. I tried vmpk version 0.6.0 but it didn’t work on my system. I saw the following error:

[steve@audio]$ vmpk
This application failed to start because it could not find or load the Qt platform plugin "xcb".

Available platform plugins are: eglfs, kms, linuxfb, minimal, minimalegl, offscreen, xcb.

Reinstalling the application may fix this problem.
Aborted (core dumped)

I suspect I have a missing indirect dependency.

Another virtual keyboard is vkeybd. I didn’t try it because it appears to be older and more basic than jack-keyboard.

Advertisements
Tagged with: ,
Posted in Tools

No MIDI Devices!

I recently got an unpleasant surprise when I tried to connect the input from a MIDI keyboard. I have a MIDI interface on my sound card plus a USB keyboard, so I was expecting to see something like the following on the ALSA tab of QjackCtl’s Connections window:

no_midi-01

Instead, what I saw was this:

no_midi-02

My MIDI input devices were gone! Where did they go?

I figured out a few things to try. First, I checked my QjackCtl settings. I didn’t see anything unexpected.

Next, I listed the ALSA MIDI devices:

[steve@audio ~]$ amidi -l
Dir Device    Name
IO  hw:0,0    M Audio Audiophile 24/96 MIDI
IO  hw:2,0,0  E-MU Xboard25 MIDI 1

Both MIDI input devices were present.

I then tried receiving ALSA MIDI input from the E-MU Xboard25:

[steve@audio ~]$ amidi -p hw:2,0,0 -d
90 3C 77
90 3C 00
90 3E 74
90 3E 00

(Press Ctrl-C to exit amidi)

That worked, too, but I didn’t know of anything else to try.

I then posted a request for help on the LinuxMusicians forum and got some helpful responses. The first hint was to run aconnect:

[steve@audio ~]$ aconnect -i
client 0: 'System' [type=kernel]
    0 'Timer           '
    1 'Announce        '
client 14: 'Midi Through' [type=kernel]
    0 'Midi Through Port-0'

My MIDI input devices should have been listed but weren’t.

The next hint was to verify that module snd_seq_midi was loaded.

[steve@audio ~]$ lsmod | grep snd_seq_midi

The command had no output, meaning the required module wasn’t loaded! I loaded it manually:

[steve@audio ~]$ sudo modprobe snd_seq_midi

I then re-ran aconnect:

[steve@audio ~]$ aconnect -i
client 0: 'System' [type=kernel]
    0 'Timer           '
    1 'Announce        '
client 14: 'Midi Through' [type=kernel]
    0 'Midi Through Port-0'
client 16: 'M Audio Audiophile 24/96' [type=kernel]
    0 'M Audio Audiophile 24/96 MIDI'
client 24: 'E-MU Xboard25' [type=kernel]
    0 'E-MU Xboard25 MIDI 1'

The missing devices were back and available in QjackCtl.

I don’t yet have a solution to this problem other than to manually load the snd_seq_midi module. The module appears to be part of the linux kernal package, so I’m hoping the problem will be solved the next time there’s a kernel update.

Note that the MIDI input devices are handled by ALSA and should show up in QjackCtl’s Connections window even if JACK isn’t running.

UPDATE 9 APRIL 2015: This is a known problem with Linux kernel 3.19 (Arch Linux bug 44286).

UPDATE 24 MAY 2015: The problem is not fixed after several kernel updates. I’ve now made a change to automatically load the missing module at startup. As root, I created a new file /etc/modules-load.d/alsa_fix.conf containing one line:

snd_seq_midi

I restarted my system and the module was automatically loaded.

Note: There’s nothing special about the first part of the name alsa_fix.conf. The first part of the name can be anything you like but it needs to end with .conf.

Tagged with: , ,
Posted in Troubleshooting

MIDI Monitors

MIDI monitor software is used to view the flow of MIDI data. This article describes a few of the MIDI monitor programs I’ve tried.

amidi

I found that I had a simple monitor available by using the command amidi that was already present on my system. Note that amidi is limited because it’s for ALSA MIDI only, not JACK MIDI.

First, I used amidi to list the available ALSA MIDI devices:

[steve@audio ~]$ amidi -l
Dir Device    Name
IO  hw:0,0    M Audio Audiophile 24/96 MIDI
IO  hw:2,0,0  E-MU Xboard25 MIDI 1

To monitor the E-MU Xboard25 keyboard, I entered the following command:

[steve@audio ~]$ amidi -p hw:2,0,0 -d

I then pressed middle C (MIDI note 60) and released it. The following output displayed:

90 3C 48
90 3C 00

The output is in hexadecimal.

amidi is not my monitor of choice but it’s useful for verifying that incoming ALSA MIDI is working.

mididings

I already had the mididings MIDI processor software installed and found that it could be used as a simple MIDI monitor. With JACK running I started mididings as follows:

[steve@audio ~]$ mididings "Print()"

I used QjackCtl to route my MIDI keyboard to mididings and then pressed and released middle C:

[ 1,  1] Note On:   60  64  (c3)
[ 1,  1] Note Off:  60  64  (c3)

The output is in decimal.

QMidiRoute

I already had the QMidiRoute software installed, which contains a simple MIDI monitor.

After JACK was started I also started QMidiRoute. I used QjackCtl to route my MIDI keyboard to QMidiRoute. Once again, I pressed and released middle C:

MM-01

midimon

I installed the dedicated MIDI monitor program midimon (version 0.3). With JACK already started I then started midimon. I used QjackCtl to route my MIDI keyboard to midimon. Once again, I pressed and released middle C:

MM-02

midimon has some interesting features. It can log the MIDI stream to a file, which can be useful. It also has checkboxes to control the types of events to be monitored. That’s useful but doesn’t go far enough; I wasn’t able to find a way to disable Active Sensing events. Overall, midimon seems to work OK but it appears to be unfinished.

Other MIDI Monitors

I didn’t look at GMIDImonitor because it appeared to be very basic.

I wanted to look at midisnoop (version 0.1.2) and kmidimon (version 0.7.5) but I was unable to build either of them.

Tagged with: , , , , ,
Posted in Tools

Multi-Way Switching in AlsaModularSynth

While creating a patch in AlsaModularSynth I ran into an interesting challenge. I wanted to add a three-way waveform switch (so that I could select the waveform with an external MIDI controller) but I didn’t see an obvious way to do multi-way switching. This post describes how I solved the problem.

First, I created a basic patch using one VCO routed to PCM Out. I used a Mixer in between but that’s optional.

ams-switch-01

I verified that I could hear the sine wave and then disconnected the cable from VCO Sine.

My next step was to implement a two-way switch between Saw and Rectangle. Here’s a schematic:

ams-switch-02

The only switch module I found was the VC Switch (on the VCA and Mix menu), which I added to my project. I also added a CV Source module (CVS on the CV Operations menu).

I then made the following connections:

  • VCO Saw to VC Switch In 0
  • VCO Rectangle to VC Switch In 1
  • CV Source CV 0 to VC Switch CV
  • VC Switch Out 0 to Mixer 2 In 0

I right-clicked the CV Source and VC Switch modules to open their respective control windows.

ams-switch-03

I was now hearing a saw wave. In the CV Source window, I increased the value of the CV 0 slider. Around 0.5 volts the sound changed from a saw wave to a rectangle wave.

In the VC Switch window, I increased the Switch level from 0.5 to 2.5 volts. The transistion between saw and rectangle now occurred at 2.5 volts.

TIP: I used the cursor arrow keys for fine control of the sliders. The up (or right) arrow increases the value; the down (or left) arrow decreases the value. In some cases the control is really fine and I had to hold an arrow key for several seconds before the value changed.

Now I had a two-way switch working, but what I really wanted was a three-way switch between saw, rectangle, and triangle, like this:

ams-switch-04

That’s not possible because the only switch module is VC Switch and it’s only two-way. However, I found that it’s possible to cascade multiple VC Switch modules to achieve multi-way switching. Here’s a schematic:

ams-switch-05

The left switch selects either saw or rectangle; the right switch selects either triangle or the output from the left switch.

To implement this, I first disconnected the cable from VC Switch Out 0. I then added another VC Switch and made the following connections:

  • CV Source CV 0 to new VC Switch CV
  • Original VC Switch Out 0 to new VC Switch In 0
  • VCO Triangle to new VC Switch In 1
  • New VC Switch Out 0 to Mixer2 In 0

The CV Source output is in the range 0 through 5 (virtual) volts. Because this is a three-way switch, I split 5 volts into thirds. I set the Switch level to 1.67 volts for the original VC Switch and to 3.33 volts for the new VC Switch.

ams-switch-06

CV Source CV 0 now selects between the three waveforms. The “trick” is that the two VC switches have overlapping ranges and that the same CV source is used for both VC switches.

Below 1.67 volts the first switch selects the saw waveform and the second switch selects the output of the first switch.

Between 1.67 and 3.33 volts the first switch selects the rectangle waveform and the second switch still selects the output of the first switch.

Above 3.33 volts the second switch selects the triangle waveform and the output of the first switch is ignored.

You can use this concept to create switches with more than three positions; just add an additional VC Switch module for each additional switch position.

Tagged with:
Posted in Instruments

Timidity++

Timidity++ is a MIDI file player (remember MIDI files?). I installed Timidity++ version 2.14.0 primarily to support another program but then got interested in using it directly. I used it to play some of the MIDI files from my collection, including two that I created myself over 20 years ago.

I first installed Arch Linux packages timidity++ and timidity-freepats as follows:

$ sudo pacman -S timidity++ timidity-freepats

Per the instructions from pacman (the Arch Linux package manager) I installed the timidity-freepats configuration file:

$ sudo -i
# cd /etc/timidity++/
# cp timidity.cfg timidity.cfg_orig
# cp timidity-freepats.cfg timidity.cfg

I could then play MIDI files with a variety of interfaces:

timidity file       # dumb interface
timidity -in file   # ncurses interface
timidity -ig file   # GTK+ interface
timidity -ik file   # Tcl/Tk interface

I also noted that I could add the option –module=1 to emulate a Roland SC-55 SoundCanvas (which I used to have):

timidity -in --module=1 file
Tagged with: ,
Posted in Tools

IceWM Appearance Revisited

I previously wrote about some appearance-related changes I’d made to my IceWM installation. At the time I’d installed packages oxygen-icons, xcursor-vanilla-dmz, and gnome-icon-theme, and then made them active by manually editing files. The results were an improvement over the default settings but most programs still looked rather unattractive. Also, in some cases the font was too big and text was truncated as a result. I found a better answer on the GTK+ page of the Arch Wiki.

Per the wiki article I installed additional packages lxappearance and gtk-engines. I also installed cantarell-fonts, which isn’t required but seems to be the default font for the standard GTK+ themes.

lxappearance

lxappearance is the appearance manager for the LXDE desktop; however, it’s powerful and works with all desktops (it doesn’t have any LXDE dependencies).

lxappearance didn’t show up on my menu so I ran it from a terminal:

$ lxappearance

Using lxappearance I was able to set a few things that I hadn’t been able to set before, including the font size. When I was done I clicked the Apply button, which changed my desktop background color to gray. Logging out and logging back in restored my desktop background.

Making these settings improved the look of GTK+ 2 applications. Presumably it doesn’t have much effect on GTK+ 3 or Qt applications but so far I’m happy with the results.

Tagged with: , , , , ,
Posted in Arch Linux

Seq24

Two years ago I wrote about the Seq24 MIDI sequencer on my previous blog. As far as I know, the information is still current and I want to make it available here.

Tagged with: ,
Posted in Tools