Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I just bought an M-Audio Keystation 49e off of craigslist and I'm at a bit of a loss on where to start to use it as an input device for muse or rosegarden.
Everything seems setup, but I'm at a loss on how to use it in the applications. It doesn't have any sound synthesis abilities on the keyboard, it's just an input device.
Without the keyboard I usually go this route:
jackd -R -d alsa &
timidity -Oj -iA &
rosegarden
And midi events output sounds and all that jazz.
I'm wanting to input notes / record from the keyboard. But still output all sounds in the aforementioned manner. If I could get those to happen while I record that would help a bunch. Maybe it's just too late in the day for me to wrap my brain around it at the moment.
Anyway the setup seems fine:
Code:
$ cat /proc/asound/cards
0 [IXP ]: ATIIXP - ATI IXP
ATI IXP rev 2 with unknown codec at 0xd0003400, irq 17
1 [Modem ]: ATIIXP-MODEM - ATI IXP Modem
ATI IXP Modem rev 2 at 0xd0003800, irq 17
2 [K49e ]: USB-Audio - Keystation 49e
Evolution Electronics Ltd. Keystation 49e at usb-0000:00:13.1-2, full speed
3 [VirMIDI ]: VirMIDI - VirMIDI
Virtual MIDI Card 1
install snd-pcsp /sbin/modprobe --ignore-install snd-pcsp $CMDLINE_OPTS && /lib/alsa/modprobe-post-install snd-pcsp
options snd-pcsp index=-2
alias char-major-116 snd
alias char-major-14 soundcore
options snd major=116 cards_limit=3
options snd-atiixp index=0
options snd-atiixp-modem index=1
options snd-usb-audio index=2
options snd-virmidi index=3
alias snd-card-0 snd-atiixp
alias snd-card-1 snd-atiixp-modem
alias snd-card-2 snd-usb-audio
alias snd-card-3 snd-virmidi
alias sound-slot-0 snd-card-0
alias sound-service-0-0 snd-mixer-oss
alias sound-service-0-1 snd-seq-oss
alias sound-service-0-3 snd-pcm-oss
alias sound-service-0-8 snd-seq-oss
alias sound-service-0-12 snd-pcm-oss
alias sound-slot-1 snd-card-1
alias sound-service-1-0 snd-mixer-oss
alias sound-service-1-1 snd-seq-oss
alias sound-service-1-3 snd-pcm-oss
alias sound-service-1-8 snd-seq-oss
alias sound-service-1-12 snd-pcm-oss
alias sound-slot-2 snd-card-2
alias sound-service-2-0 snd-mixer-oss
alias sound-service-2-1 snd-seq-oss
alias sound-service-2-3 snd-pcm-oss
alias sound-service-2-8 snd-seq-oss
alias sound-service-2-12 snd-pcm-oss
alias sound-slot-3 snd-card-3
alias sound-service-3-0 snd-mixer-oss
alias sound-service-3-1 snd-seq-oss
alias sound-service-3-3 snd-pcm-oss
alias sound-service-3-8 snd-seq-oss
alias sound-service-3-12 snd-pcm-oss
In theory client 24: should be the input device I want. I just can't seem to connect the dots. 128: would be the timidity output devices. The TLDP midi tutorial seemed to help with said config. But that's about all it helped with. And I don't seem to even need the virmidi component.
I've tried amsynth and spiralsynthmodular, but I still can't figure out how to bridge the gap from midi input to timidity output. I've tried muse and rosegarden but I'm at a loss since I've always just edited, not inputed midi events with a midi device.
Any down and dirty get the ball rolling. At least to verify that the device actually works would help.
Minor progress. In rosegarden under studio -> manage midi devices, there is a center column under record devices labeled current. It's an empty box with No by default. Clicking it makes it checked and yes. And the keyboard now makes sounds. Quite the latency on the event, but sounds at last. However pressing record yields no record device selected, and I'm still unsure of where to select that. I [X]'d out the other control panel where you usually set instrument bank and stuff and I don't seem to be able to regain it. Even after re-installing rosegarden through the gratuitous dpkg --purge --force-all and apt-get install method. Anyway I guess the keyboard does work, sort of.
More progress. Using qsynth with fluid-soundfont-* and other parts I've been able to have a much less latent synth of sorts. I had to set the midi driver to OSS and the midi device to /dev/midi2, but once that was set, plus an sf2 soundfont selected, it works. I have sequencer and oss emulation active in alsa.
works
/usr/share/sounds/sf2/FluidR3_GM.sf2 (piano)
/usr/share/doc/libfluidsynth-dev/examples/example.sf2 (cheap organ)
doesn't work
/usr/share/sounds/sf2/FluidR3_GS.sf2 (???)
I was able to get recorded input from the midi device in rosegarden. I'm not entire sure how I did that, but I guess if you change enough options, things happen. Still not that useful with such a hefty latency. No luck restoring my segment something or other edit window. On to the svn version I guess. I was not able to assign anything other than program 1 of general midi to the synth (piano), although if that edit window didn't go on vacation it would have been possible to make that change IMO. Or not.
qsynth is a nifty little thing with whatever .sf2 files I can scrounge up on the internet. With some way to put that between rosegarden and timidity. And with qsynth -a oss (or -a alsa) you can do all that without jackd. I guess I'm figuring it all out, I'm just surprised that it's not simpler / default behavior. As some of the apps wouldn't even launch without a midi device present. But I guess typical midi devices have their own sounds on the device with zero latency. And I probably need to upgrade my 4yo laptop at some point.
before launching the update and everything is as it should be. With fancy new look. And the Studio -> Manage Midi Devices was simple and intuitive. Click in the input device I want(24:0 / Keystation 49e), it changes color. Click on the output device I want(128:0 / Timidity) and it changes color. Note on the keyboard sounds note on timidity daemon. With that Special Parameters / Segment + Track + Instrument panel back in place I can select different midi sounds and it just works. There's still a pretty hefty latency though. As in half a second after I push the key on the keyboard a sound comes out of the speakers.
Compile from source went without a hitch, although a bit resource hungry and time consuming. But I've previously installed stuff from source so all of my deps were met from those efforts.
Code:
$ sh bootstrap.sh
$ ./configure --prefix=/usr
$ make
$ su
# make install
$ exit
$ exit
I can record from the midi device and your basic stuff. (If I only knew how to play keyboard better). Now to see what I can do with Muse. Or if qsynth with rosegarden might ease the latency issue.
More progress, but latency seems to be the issue of no remorse. I gave up on qsynth and went direct to fluidsynth.
Down to the basics.
in 4 Eterms on an inactive workspace / desktop in this order.
$ jackd -R -d alsa
$ timidity -Oj -iA
$ fluidsynth general_midi_soundfont.sf2
$ rosegarden
And switch to the other workspace before rosegarden launches. Once up you can select a new midi device which is fluidsynth as the output midi device. Everything else stays pretty much the same. I'm currently trying out merlin_gmv22.sf2 as the soundfont. It has a rather nice horn sound and brass in general, plus percussion sounds are better IMO. Volumes seem a little off which plays with the balance of some existing .mid files. But otherwise a nice collection. There is still a bit of latency, but it's mildly better with fluidsynth. I could probably forgo even running timidity, but old habits and all. It might also give an opportunity to A/B between general midi original and enhanced for all intents.
$ fluidsynth -ni soundfont.sf2 midifile.mid
To play a midi file with a particular soundfont. And probably tons of other stuff I have yet to discover.
I managed to lower the latency a bit by mimic-ing what qsynth does in terms of settings. Relative to the defaults that didn't / don't match to fluidsynth.
Code:
$ fluidsynth -C no -R no -o
audio.periods=2,audio.jack-autoconnect=1,audio.jack.id='custom',
audio.driver='oss',synth.sample-rate=48000,
midi.driver='oss',midi.oss.device='/dev/midi3'
/home/user/media/midi/soundfonts/merlin_gmv22.sf2
Some lines broken up to prevent the scrollbar thing. The main points of interest, driver shift to OSS (emulated in alsa --with-oss=yes), periods to 2 (default 16), well it's all somewhat important I guess. Still some latency, but I can almost track to something (or at least the click track) now.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.