clavier 2 sequencer

This is a brief run-through of making the software keyboards clavier output midi so that it can be recorded in the melys or jazz++ sequencers. clavier enables you to play them with a mouse or more usefully, use the computer keyboard. I'm using ALSA 0.5.7 (you can't do this with OSS). ALSA 0.5.8 breaks both melys and jazz++ in impressive ways but I'm told ALSA is OK in CVS (at least for melys) so the next release should be OK again. I'm also using clavier-0.1.3, Melys 0.1.17 and jazz++ 4.1.3 and kernel 2.2.13 (now updated to 2.2.16). There are URLs at the bottom of this page. OK, here's what we do: first run 'ls /proc/asound/dev/' and you'll get something like ... controlC0 hwC0D0 controlC1 midiC0D0 controlC2 midiC0D1 ... then insert the ALSA virmidi module ... 'modprobe snd-card-virmidi snd_index=2' if you already have 2 sound cards, your output of 'ls /proc/asound/dev/' might now look like this ... controlC0 hwC0D0 midiC0D2 midiC2D1 mixerC0D0 pcmC0D0p pcmC1D1p controlC1 midiC0D0 midiC1D0 midiC2D2 mixerC1D0 pcmC1D0c seq controlC2 midiC0D1 midiC2D0 midiC2D3 pcmC0D0c pcmC1D0p timer You'll see a new card has been created - in this case midiC2 (0, 1 and the third card, 2) This gives you the interface that clavier wants so you'd direct your output to the new card, midiC2D0 'clavier -o /proc/asound/dev/midiC2D0 &' The next step is to let Melys know the new input port. Right now it'll be set in your .tcshrc or whatever to 'SETENV ALSA_INPUT_PORTS 64:0' or something similar which is the external port on card 1. What to set it to now? I used 'pmidi -l' and on my system I got ... Port Client name Port name 64:0 External MIDI 0 MIDI 0-0 65:0 Emu8000 WaveTable Emu8000 Port 0 65:1 Emu8000 WaveTable Emu8000 Port 1 65:2 Emu8000 WaveTable Emu8000 Port 2 65:3 Emu8000 WaveTable Emu8000 Port 3 72:0 External MIDI 1 MIDI 1-0 80:0 Virtual Raw MIDI 2:0 Virtual Raw MIDI 2:0 81:0 Virtual Raw MIDI 2:1 Virtual Raw MIDI 2:1 82:0 Virtual Raw MIDI 2:2 Virtual Raw MIDI 2:2 83:0 Virtual Raw MIDI 2:3 Virtual Raw MIDI 2:3 If you just have one card the new card will start at 72:0 - for me its 80:0. So the variable should now be ... ALSA_INPUT_PORTS 80:0 (or 72:0 if you have one soundcard) Fire up Melys (after making sure that you really have re-set that variable) and you'll be able to record the output of the software keyboards... as it stands you'll only be able to hear the output of the keyboards when you're recording, and in jazz++ you won't hear the output until you play back! This is where ALSA's multiple connections come in really handy (again!). Using 'aconnect' (man extract below) You can do 'aconnect 80:0 65:1' which will send your keyboard output to the onboard synth as well so you can hear it while you practise etc. Things that don't work so well yet include program changes on clavier (say to the drum channel) which turn off keyboard entry (but keep mouse entry). [man aconnect extract] For example, to connect from port 64:0 to 65:0, run as follows: % aconnect 64:0 65:0 The connection is one-way, and the whole data to the sender port (64:0) is redirected to the receiver port (65:0). When another port (e.g. 65:1) is attached to the same sender port, the data is sent to both receiver ports. For disconnection, use -d option. % aconnect -d 64:0 65:0 Another function of aconnect is to list the present ports on the given condition. The input ports, which may become sender ports, can be listed with -i option. % aconnect -i client 0: 'System' [group=system] [type=kernel] 0 'Timer ' [group=system] 1 'Announce ' [group=system] client 64: '0: MIDI Synth' [group=] [type=kernel] 0 'card 0: synth-midi: 0' [group=device] [extract from alsa-driver-0.5.x/cards/card-virmidi.c] * VIRTUAL RAW MIDI DEVICE CARDS * * This dummy card contains up to 4 virtual rawmidi devices. * They are not real rawmidi devices but just associated with sequencer * clients, so that any input/output sources can be connected as a raw * MIDI device arbitrary. * Also, multiple access is allowed to a single rawmidi device. * * Typical usage is like following: * - Load snd-card-virmidi module. * # modprobe snd-card-virmidi snd_index=2 * Then, sequencer clients 72:0 to 75:0 will be created, which are * mapped from /dev/snd/midiC1D0 to /dev/snd/midiC1D3, respectively. * * - Connect input/output via aconnect. * % aconnect 64:0 72:0 # keyboard input redirection 64:0 -> 72:0 * % aconnect 72:0 65:0 # output device redirection 72:0 -> 65:0 * * - Run application using a midi device (eg. /dev/snd/midiC1D0) Links: ALSA These ALSA rpms are for kernel 2.2.13...and are i386: alsa-driver 0.5.7 RPM alsa-lib 0.5.7 RPM alsa-util 0.5.7 RPM These ALSA rpms are for kernel 2.2.16 and 2.2.16LL (lowlatency patch) and are i586: For more info on the low latency patch read this. alsa-driver 0.5.7 i586 RPM alsa-lib 0.5.7 i586 RPM alsa-util 0.5.7 i586 RPM Clavier Melys Jazz++ j littler@nirvanet net 20 Jul 00
 home  music  news  opinion  software  tips  email