LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 04-30-2008, 11:11 AM   #1
jsmith6
Member
 
Registered: Feb 2006
Distribution: Slackware 13.1 / 13.37
Posts: 91

Rep: Reputation: 16
I cannot play midi files (.mid)


I am talking about playback, not composing using a Midi keyboard.

First I made sure that all my volume controls are at max, except from "Front" which is always at zero (I can't move it). I have a Creative Soundblaster Live (I think it's the "4.1" version). lspci sais:

Code:
02:0d.0 Multimedia audio controller: Creative Labs SB Live! EMU10k1 (rev 08)
02:0d.1 Input device controller: Creative Labs SB Live! Game Port (rev 08)
My first try was with Audacious. But when I open the midi file, the program just pauses and it doesn't close unless I "kill" it.

Then I tried KMid (from KDE). I can see the timeline (the "seek" switch that lets me go back and forward in a music file) progressing but I cannot hear any sound.

My media player of choice under Windows is an old version of WinAMP 2.x and it can play midi files. So, I tried running WinAMP with Wine. WinAMP can playback MP3 files under Wine, but not Midi ones. Again, I see the timeline progressing but I cannot hear the music.

I first noticed this when I tried to play Prboom (a classic Doom1/2 port) and I couldn't hear music.

Any suggestions?
 
Old 04-30-2008, 11:34 AM   #2
H_TeXMeX_H
LQ Guru
 
Registered: Oct 2005
Location: $RANDOM
Distribution: slackware64
Posts: 12,928
Blog Entries: 2

Rep: Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301
Well, here's how I play 'em.

1) Download and install fluidsynth (a software synthesizer, in case your card doesn't have a hardware synthesizer, which mine doesn't):
http://fluidsynth.resonance.org/trac
or the Slackbuild:
http://slackbuilds.org/repository/12...ia/fluidsynth/

2) Download a sound font, say from here:
http://www.personalcopy.com/linuxfiles.htm

3) Then you can play them like:
Code:
fluidsynth -i Unison.sf2 file.mid
 
Old 04-30-2008, 12:12 PM   #3
tobyl
Member
 
Registered: Apr 2003
Location: uk
Distribution: slackware current
Posts: 768

Rep: Reputation: 64
I have that sound card.(rev 07)

TexMex's solution might be better than mine, but this is what I did

- it took me a while to figure it out, and I am trying to remember what I did.

I think the important bit was /etc/modprobe.d/modprobe.conf (actually in my case that is a link to /etc/modprobe.conf)

mine looks like this

# ALSA portion
alias char-major-116 snd
alias snd-card-0 snd-emu10k1
# module options should go here

# OSS/Free portion
alias char-major-14 soundcore
alias sound-slot-0 snd-card-0

# card #1
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

reboot I guess here
then in kde you have to go into Settings>Sound and Multimedia>Sound System and select Hardware tab

In the Select Midi device section, I selected SBLive! Platinum [CT4760P] EMU10K1 MPU-401 (UART).......

and it has worked ever since.

You may need to manually modprobe some stuff, I don't seem to need to though

here are the relevant bits from my lsmod:

Module Size Used by
snd_seq_midi 5920 0
snd_emu10k1_synth 6016 0
snd_emux_synth 31360 1 snd_emu10k1_synth
snd_seq_virmidi 5120 1 snd_emux_synth
snd_seq_midi_emul 5632 1 snd_emux_synth
snd_seq_oss 28864 0
snd_seq_midi_event 6016 3 snd_seq_midi,snd_seq_virmidi,snd_seq_oss
snd_seq 46448 8 snd_seq_midi,snd_emux_synth,snd_seq_virmidi,snd_seq_midi_emul,snd_seq_oss,snd_seq_midi_event
snd_pcm_oss 34592 0
snd_mixer_oss 13888 1 snd_pcm_oss

snd_emu10k1 134016 1 snd_emu10k1_synth
snd_rawmidi 18720 3 snd_seq_midi,snd_seq_virmidi,snd_emu10k1
snd_ac97_codec 93408 1 snd_emu10k1
ac97_bus 1472 1 snd_ac97_codec
snd_pcm 59396 3 snd_pcm_oss,snd_emu10k1,snd_ac97_codec
snd_seq_device 6220 7 snd_seq_midi,snd_emu10k1_synth,snd_emux_synth,snd_seq_oss,snd_seq,snd_emu10k1,snd_rawmidi
snd_timer 18824 3 snd_seq,snd_emu10k1,snd_pcm
snd_page_alloc 7432 2 snd_emu10k1,snd_pcm
snd_util_mem 3328 2 snd_emux_synth,snd_emu10k1

snd_hwdep 6724 2 snd_emux_synth,snd_emu10k1
snd 43620 13 snd_emux_synth,snd_seq_virmidi,snd_seq_oss,snd_seq,snd_pcm_oss,snd_mixer_oss,snd_emu10k1,snd_rawmidi ,snd_ac97_codec,snd_pcm,snd_seq_device,snd_timer,snd_hwdep

seems like an absurd amount of modules just for sound, but thats what I have

you may also need to fiddle around in alsamixer as well
(my memory is a bit hazy)

tobyl

Oh, I have some soundfonts in /etc/midi

2GMGSMT.SF2 4GMGSMT.SF2 8MBGMSFX.SF2

I may have got them off the SBlive install disk for windows, I just cant recall.
I can send you copies if you want

Last edited by tobyl; 04-30-2008 at 12:25 PM. Reason: tha last bit
 
Old 05-05-2008, 06:39 PM   #4
jsmith6
Member
 
Registered: Feb 2006
Distribution: Slackware 13.1 / 13.37
Posts: 91

Original Poster
Rep: Reputation: 16
Quote:
Originally Posted by H_TeXMeX_H View Post
1) Download and install fluidsynth
2) Download a sound font
3) Then you can play them like:
This worked. I can now playback midi files with this specific player.

However, I was hoping for a more broad solution. Enabling midi for all media players that support it.

tobyl, I tried adding these lines on my modprobe.conf but I got some error messages for each line that I added on modprobe.conf.

lsmod | grep -i midi gives me:

Code:
snd_seq_midi_event     10112  1 snd_seq_oss
snd_seq                50640  5 snd_seq_dummy,snd_seq_oss,snd_seq_midi_event
snd_rawmidi            22560  1 snd_emu10k1
snd_seq_device         10508  5 snd_seq_dummy,snd_seq_oss,snd_seq,snd_emu10k1,snd_rawmidi
snd                    47204  15 snd_seq_oss,snd_seq,snd_pcm_oss,snd_mixer_oss,snd_emu10k1,snd_rawmidi,snd_ac97_codec,snd_pcm,snd_seq_device,snd_timer,snd_hwdep
and lsmod | grep -i snd gives me:

Code:
snd_seq_dummy           6788  0 
snd_seq_oss            32896  0 
snd_seq_midi_event     10112  1 snd_seq_oss
snd_seq                50640  5 snd_seq_dummy,snd_seq_oss,snd_seq_midi_event
snd_pcm_oss            42784  0 
snd_mixer_oss          18048  1 snd_pcm_oss
snd_emu10k1           131904  2 
snd_rawmidi            22560  1 snd_emu10k1
snd_ac97_codec         98980  1 snd_emu10k1
ac97_bus                6016  1 snd_ac97_codec
snd_pcm                72068  3 snd_pcm_oss,snd_emu10k1,snd_ac97_codec
snd_seq_device         10508  5 snd_seq_dummy,snd_seq_oss,snd_seq,snd_emu10k1,snd_rawmidi
snd_timer              22532  3 snd_seq,snd_emu10k1,snd_pcm
snd_page_alloc         11528  2 snd_emu10k1,snd_pcm
snd_util_mem            7552  1 snd_emu10k1
snd_hwdep              10628  1 snd_emu10k1
snd                    47204  15 snd_seq_oss,snd_seq,snd_pcm_oss,snd_mixer_oss,snd_emu10k1,snd_rawmidi,snd_ac97_codec,snd_pcm,snd_seq_device,snd_timer,snd_hwdep
soundcore               9824  1 snd
I also don't have the 2GMGSMT.SF2 4GMGSMT.SF2 8MBGMSFX.SF2 files. Are there inside the soundcard's CD? I think I already have lost that. If it's not too much trouble send them over (e-mail or a link to a hosting site, anything that is convenient for you. If you choose e-mail then I would prefer to give you my e-mail address with a PM to avoid spam-bots.)
 
Old 05-05-2008, 07:25 PM   #5
Daedra
Senior Member
 
Registered: Dec 2005
Location: Springfield, MO
Distribution: Slackware64-15.0
Posts: 2,682

Rep: Reputation: 1375Reputation: 1375Reputation: 1375Reputation: 1375Reputation: 1375Reputation: 1375Reputation: 1375Reputation: 1375Reputation: 1375Reputation: 1375
I copies this directly from an old post i made a while back, this works for all SB, Audigy Cards... here is the original post http://www.linuxquestions.org/questi...orking-514532/

To get midi working you need to load a soundfont. I'll give you a walkthrough because I had the same problem, Here is exactly what I did.

1) you need to download the awesfx package, you can either download it from source and compile it yourself (you can get it from http://www.alsa-project.org/~iwai/awedrv.html. Or you can download the precompiled slackware package from here http://www.linuxpackages.net/pkg_details.php?id=6493. once you have installed the package go to step 2.

2)once you have the program installed you need do load a soundfont, I don't really feel like going into detail on what a sound font is, so let me just say you need it, for more detailed explaination go to google, anyway there are MANY different sound fonts you can use to get different sounds, however I prefer the sound font that comes with the creative windows drivers you can get it from here http://webpages.charter.net/daedra/ct4mgm.sf2.

3) load the sound font with this program from the package you installed above - asfxload ct4mgm.sf2. If you get no errors then the sound font should be installed. Now there are many different programs to use to play midi's but im going to assume you have KDE so use the program kmid, just type kmid from the run command.

4)once kmid is up, go to settings/midi setup and you should see a list of available devices like this
Midi Through Midi Through Port-0
Audigy 2 Platinum [SB0240P] Audigy MPU-401 (UART)
Audigy 2 Platinum [SB0240P] Audigy MPU-401 #2
Emu10k1 WaveTable Emu10k1 Port 0
Emu10k1 WaveTable Emu10k1 Port 1
Emu10k1 WaveTable Emu10k1 Port 2
Emu10k1 WaveTable Emu10k1 Port 3
you should be able to use any of the bottom 4, but I personally use "Emu10k1 WaveTable Emu10k1 Port 0". Once you select that select a midi file and you should have sound. Let me know how it goes.

Last edited by Daedra; 05-05-2008 at 07:31 PM.
 
Old 05-05-2008, 07:54 PM   #6
randomsel
Member
 
Registered: Oct 2006
Location: Wilmington, DE
Distribution: Slackware 11
Posts: 201

Rep: Reputation: 30
Another choice for software synthesizer would be Timidity++, which is one solution that I've tried. You might also like Alien Bob's build. Haven't tried that last one, but, hey, it's by Alien Bob, so it'll work.
 
Old 05-05-2008, 08:22 PM   #7
Daedra
Senior Member
 
Registered: Dec 2005
Location: Springfield, MO
Distribution: Slackware64-15.0
Posts: 2,682

Rep: Reputation: 1375Reputation: 1375Reputation: 1375Reputation: 1375Reputation: 1375Reputation: 1375Reputation: 1375Reputation: 1375Reputation: 1375Reputation: 1375
agreed, Timidity++ is great, but it is not necessary if you have a creative labs card
 
Old 05-06-2008, 06:11 AM   #8
tobyl
Member
 
Registered: Apr 2003
Location: uk
Distribution: slackware current
Posts: 768

Rep: Reputation: 64
Daedra is right of course, and mentions loading the soundfont into the card, which I omitted.

You can add the asfxload command to your /etc/rc.local and forget about it if you want, (I did!)


I expect the soundfont files mentioned previously by texmex and daedra are better than the ones I got from the creative cd, but I am happy to send them if you wish, just reply to my email.

tobyl


edit: I did some more playing around.

The alsa people link to one of the soundfont files that I used here:

http://alsa.opensrc.org/index.php/8MBGMSFX.SF2

The gumf I told you about the modprobe.conf seems unecessary. I think udev takes care of most of it. In /etc/modprobe.d there is in my case a file called 'sound' which contains

alias snd-card-0 snd-emu10k1
alias sound-slot-0 snd-emu10k1

After that it only seems necessary to do the following:

modprobe snd_seq_midi
modprobe snd_emu10k1_synth

asfxload /etc/midi/8MBGMSFX.SF2 (or whatever soundfont you choose to use).

there is probably a neat way to do the two modprobe commands from that same 'sound' file, but I dont know the syntax.

Last edited by tobyl; 05-06-2008 at 08:02 AM.
 
Old 05-08-2008, 07:14 AM   #9
jsmith6
Member
 
Registered: Feb 2006
Distribution: Slackware 13.1 / 13.37
Posts: 91

Original Poster
Rep: Reputation: 16
Quote:
Originally Posted by randomsel View Post
Another choice for software synthesizer would be Timidity++, which is one solution that I've tried. You might also like Alien Bob's build. Haven't tried that last one, but, hey, it's by Alien Bob, so it'll work.
The error message of prboom mentioned that it couldn't find Timidity. So I eventually compiled it (Alien Bob's package was for version 10.2).

It took several tries till I get it configured. I could playback Midi files with Timidity using an .SF2 file but prboom couldn't playback Midi.

So I searched a bit more. I found a link on Prbooms's Linux instructions that led me to download a set of instruments.

I eventually made Midi work inside prboom! There is a catch though. I have to execute prboom from inside the directory where I have the instruments (for me it's /usr/share/timidity/instruments). Small is the cost for the beauty of having Midi playback while playing Doom :-P

Quote:
Originally Posted by Daedra
3) load the sound font with this program from the package you installed above - asfxload ct4mgm.sf2. If you get no errors then the sound font should be installed. Now there are many different programs to use to play midi's but im going to assume you have KDE so use the program kmid, just type kmid from the run command.
I choose to compile since the linuxpackage.net's package was for version 10.2. Compiled like a charm with the Slackbuild for 12.0.

The file that you linked, ct4mgm.sf2, is not in that URL anymore. I tried with 8MBGMSFX.SF2 and Unison.sf2 and got this error:

Code:
No Emux synth hwdep device is found
So I did as tobyl suggested:

Quote:
Originally Posted by tobyl
modprobe snd_seq_midi
modprobe snd_emu10k1_synth
And after that, asfxload could load any .sf2 file. KMid works and so does Audacious.

Thank you all gyus!

P.S.: I will upgrade In a few weeks, I hope this will work on 12.1 as well :-P
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
K mid will not play midi files metalearth Linux - Software 8 07-12-2007 04:32 PM
Cannot play MIDI files! koolgentoo Linux - Hardware 2 07-24-2005 07:26 AM
How to play MIDI files: needed a MIDI mapper? vharishankar Linux - General 3 12-30-2004 12:12 AM
Cannot play midi files... djib Linux - Laptop and Netbook 1 12-04-2004 07:46 PM
How do I play MIDI files? sirhack Linux - Hardware 1 04-06-2003 08:30 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 07:17 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration