Skip to main content
Topic: NWC, Linux and MIDI devices (Read 10976 times) previous topic - next topic

NWC, Linux and MIDI devices

I have gotten NWC to run quite nicely under Linux, but one problem persists: lack of MIDI devices.

I currently have two software synths installed, Timidity++ and FluidSynth. The problem is, they don't work properly as MIDI devices.

I can play individual MIDI files with both of them, and after a bit of a struggle, I got them to appear in the KDE Control Center as MIDI devices.

However, FluidSynth reserves the whole sound system when it is loaded and won't play any sound. Timidity doesn't persistently reserve all sound output, but it is mute too. (I've tried the Test Midi button in KDE Control Center.)

The Wine MIDI Mapper device doesn't work either. When I select it in NWC (as it is the only device available there), NWC complains that there are some problems and tells they need to be fixed before continuing (it doesn't tell what the problems are, though).

Re: NWC, Linux and MIDI devices

Reply #1
Thanks for that info, JB.

Re: NWC, Linux and MIDI devices

Reply #2
Wonder if experimentation might help.

See if Synthfont will work in Linux. Great little program, though it, like any synth font program is demanding on CPU's. http://www.synthfont.com/. I use Synthfont in my laptop while travelling, since its onboard midi generator is deplorable.

If it does work, Sue Morton in the NWC newsgroup on or about 11/29/04 mentioned another little program called midiyoke that can be used to directly use synthfont as the output and input for nwc. Get the software at http://midiox.com/myoke.htm.

Possible that the two in tandem could work, though Linux does present some challenges to PC based programs.

Re: NWC, Linux and MIDI devices

Reply #3
Why, I'm no stranger to SynthFont; I use it in Windows all the time. However, it seems that Kenneth hasn't made a Linux version of it, and I have doubts of its usefulness under Wine (After all, the same functionality on a per-file basis can be achieved using Timidity or FluidSynth).

Because Timi and FS both work as mere MIDI players, but not as devices, I suppose I have just a configuration issue; maybe I need to make some port bindings, maybe something else... Linux configuration can be so tedious.

A tip for all of you who want to have Linux but also want to run NWC: I recommend Fedora Core 3 as the distribution. One of its advantages is a very good support for TrueType fonts; they can be installed with just a couple of clicks (with the Font Installer app).

Re: NWC, Linux and MIDI devices

Reply #4
One more thing: people who have "real" sound cards (not just an integrated chip) may have better luck in MIDI support; I have a laptop so the only option would be some special sound card (I think someone mentioned a special version of Audigy that could used via PCMCIA or somehow else), but those are probably too expensive and maybe do not work especially well.

Re: NWC, Linux and MIDI devices

Reply #5
I don't know about "currently available" PCMCIA sound cards for laptops, but I tried one about 3 years ago, with my prior laptop. The PCMCIA was no different than the one built into the laptop. In some ways, it was worse, because it would have cost some $50.

Re: NWC, Linux and MIDI devices

Reply #6
I got NWC working under linux (fedora 3) with wine (crossover office, but I think it works with any wine) with timidity and alsa.

First catch was that you need to edit the wine config file (called config) so that it has the lines

[WINMM]
"Drivers" = "winealsa.drv"

[ALSA]
"PlaybackDevice" = "default"

Then you need to make sure you have the right module running.  For me the module  can be started with the command

modprobe snd_emu10k1_synth

Then you can open timidity as a server

timidity -iA -A170 -B3,10 -Os -EFreverb=0 &

It should respond with something like

Requested buffer size 32768, fragment size 8192
ALSA pcm 'default' set buffer size 32768, period size 8192 bytes
TiMidity starting in ALSA server mode
Opening sequencer port: 129:0 129:1 129:2 129:3

Then when you open nwc32 under wine, it sees timidity as a sequencer.

Re: NWC, Linux and MIDI devices

Reply #7
Well, congratulations! Too bad that it didn't work for me :(

You modprobed snd_emu10k1_synth; is there a specific purpose for that? I always have started Timidity by first modprobing snd_virmidi and then running timidity with quite the same settings as you do (I could try the exact same ones, though...)

Timidity starts up fine, an I know it is working: other programs, like DosBox can use timidity for midi output.

In the wined NWC32, all I see is Wine midi out mapper, and if I select that and click OK, I see an error message: "The following play devices failed to open properly: Wine midi out mapper. This problem must be corrected before proceeding."

Re: NWC, Linux and MIDI devices

Reply #8
It works for me! (mostly).
I had to copy the file /usr/share/wine/config into my ~/.wine/ directory, then it worked.

However, it doesn't seem to respect the speed it should be playing stuff, and is playing veeeerrryyy slowly...

Re: NWC, Linux and MIDI devices

Reply #9
What files do you have in /usr/share/wine/config/? I don't even have such a directory.

Re: NWC, Linux and MIDI devices

Reply #10
Ah, I found it out: I had to copy config from /etc/wine/ to ~/.wine.

Now it works fabulously well. Thank you Steve S and dan! One reason less to use Windows... :)

Re: NWC, Linux and MIDI devices

Reply #11
I've mostly got NWC running under WINE too.

However, I cannot get Timidity to start up as a server.  I'm running FC3.

Here is what I did, following instructions from Steve S and others:

1. copied /etc/wine/config to ~/.wine/config
2. altered [WinMM] entry and added [ALSA] entry
3. modprobe snd_emu10k1_synth
4. timidity -iA -A170 -B3,10 -Os -EFreverb=0 &

#4 is where I am stuck.  Here is the ouput:
Requested buffer size 12288, fragment size 4096
ALSA pcm 'default' set buffer size 12288, period size 4096 bytes
TiMidity starting in ALSA server mode
ALSA lib seq_hw.c:446:(snd_seq_hw_open) open /dev/snd/seq failed: No such file or directory
error in snd_seq_open

Here is my lsmod for all modules with 'synth':
> lsmod | grep synth
snd_emu10k1_synth      7745  0
snd_emux_synth        38081  1 snd_emu10k1_synth
snd_seq_virmidi        6593  1 snd_emux_synth
snd_seq_midi_emul      6593  1 snd_emux_synth
snd_seq                54097  4 snd_emux_synth,snd_seq_virmidi,snd_seq_midi_event,snd_seq_midi_emul
snd_emu10k1            91845  5 snd_emu10k1_synth
snd_seq_device          8525  5 snd_emu10k1_synth,snd_emux_synth,snd_seq,snd_emu10k1,snd_rawmidi
snd_util_mem            4801  2 snd_emux_synth,snd_emu10k1
snd_hwdep              8901  2 snd_emux_synth,snd_emu10k1
snd                    52261  15 snd_emux_synth,snd_seq_virmidi,snd_seq,snd_emu10k1,snd_rawmidi,snd_seq_device,snd_ac97_codec,snd_pcm_oss,snd_mixer_oss,snd_pcm,snd_timer,snd_hwdep

But, as the message says, I have no /dev/snd/seq
> ls /dev/snd
controlC0  hwC0D0  midiC0D0  pcmC0D0c  pcmC0D0p  pcmC0D1c  pcmC0D2c  pcmC0D2p  timer

I'm confused and way beyond my depth.  Help!

David

Re: NWC, Linux and MIDI devices

Reply #12
I'll answer my own question, in case others run into it.  (That means I got it working finally!!)

Instead of
modprobe snd_emu10k1_synth
as Steve S suggests, I used
modprobe snd_virmidi
as Jussi suggests.

Then I started timidity just as in Steve's example and it was happy.

When I started NWC, lo and behold, there were all kinds of choices for Midi device.  I chose TiMidity, but I also have
- EMU10k1 MPU-401 (UART)
- Emu10k1 WaveTable (4 which all look the same)
- Virtual Raw Midi 1-0
- Virtual Raw Midi 1-1
- Virtual Raw Midi 1-2
- Virtual Raw Midi 1-3

Which one(s) should I chose?  I have a SB Live card.  Anyway, I'm getting sound now, so I'm happy.

Thanks,
David

Re: NWC, Linux and MIDI devices

Reply #13
Timidity is the correct one, I guess (at least it's working for me).

Virtual Raw Midi devices are sort of "pipes" (that aconnect uses to bind the sequencer to timidity raw input). I don't know exactly why there's so many of them (four), maybe that just is so.

Note, that unless you make the virmidi module load at startup, the virmidi ports are gone if you reboot.

The EMU ones are probably the result of a modprobe snd_emu10k1_synth. You can probably get them out with modprobe -r snd_emu10k1_synth.

***

In case you want to use Timidity in other applications, it is located in ports 128:0, 128:1, 128:2 and 128:3 by default. If you have other MIDI devices enabled too, that port may be different. Use aconnect -lo to check, typical output would be like:

client 128: 'TiMidity' [type=user]
0 'TiMidity port 0 '
1 'TiMidity port 1 '
2 'TiMidity port 2 '
3 'TiMidity port 3 '

If an application asks for a midi port, 128:0 should be OK. In case there is no obvious place to enter a port (and you get no sound), just try any midiconfig= or config= in the config file you find... Also try both 128:0 and 0:128, or even 128 0.

Re: NWC, Linux and MIDI devices

Reply #14
I downloaded TiMidity, but when I built it something seems to have been left out.  How do I compile in support for 'interface A'.  When
I try entering the command in reply 6 I get the followiing error:

[andrew@localhost Software]$ timidity -iA -A170 -B3,10 -Os -EFreverb=0 &
[1] 7953
[andrew@localhost Software]$ /usr/local/share/timidity/timidity.cfg: No such file or directory
Interface `A' is not compiled in.
timidity: Can't read any configuration file.
Please check /usr/local/share/timidity/timidity.cfg

I would appreciate any help you can give me.

Andrew Ramage

Re: NWC, Linux and MIDI devices

Reply #15
What distribution do you use? If there is a package manager available (yum in FC, apt in Debian, urpmi in Mandrake etc.), try installing Timidity with it.

I really don't know about building Timidity from source; I run FC3, and installed it with yum.

Re: NWC, Linux and MIDI devices

Reply #16
I use Mandrake 10.0 (on this machine, the other one runs SuSE 9.2) BUT iI've never heard of unpmi.  What is it ?  Command-line or graphical ?

Re: NWC, Linux and MIDI devices

Reply #17
It's been a while since I've used Mandrake, but I think urpmi is command-line, like the other package managers. I think just saying urpmi timidity++ (or if that doesn't work, urpmi timidity) will do.

To see the the correct syntax to install packages, just do a man urpmi (after all, it could also be urpmi i <package> etc.)

Re: NWC, Linux and MIDI devices

Reply #18
For other reasons, I had to do a complete re-install of Mandrake.  I found TiMidity inthe list of available packages so it's now installed.  Do I have to enter the timidity line above as root ?

Re: NWC, Linux and MIDI devices

Reply #19
There's no need, but do remember to install the virtual MIDI ports.

Also see My Timidity++ Howto, there is some useful advice there.

Re: NWC, Linux and MIDI devices

Reply #20
Thanks for all the help, friends. I've been trying for a year to get NWC working with wine. Now it is, thanks to your hints, a proper wine installation, and the very useful WineTools.

Now does anyone know how to get SharpEye2 working under Wine?

Re: NWC, Linux and MIDI devices

Reply #21
It is much easier to get midi working under linux if you have a soundfount compatible soundcard!

you have to use the snd-¨whatever¨ driver

install Kmid  (not kmidi)
install awe tools
put a soundfont in an easily accessible place

in the sound server setup choose emu10k1 - port 0-3 (any of those will work fine)
for the midi mapper use /usr/share/apps/kmid/maps/gm.map

go to your console and type in sfxload ¨path to soundfont¨ hit enter
if it went back to the prompt it loaded just fine.

now open NWC and press play. you should hear midi.

It works well for me