Lyrics & Knowledge Personal Pages Record Shop Auction Links Radio & Media Kids Membership Help
The Mudcat Cafesj

Post to this Thread - Sort Descending - Printer Friendly - Home


Tech: Playing Midi Files on Linux

The Fooles Troupe 07 Jul 10 - 08:19 PM
Tangledwood 07 Jul 10 - 10:29 PM
The Fooles Troupe 08 Jul 10 - 01:36 AM
pavane 08 Jul 10 - 03:17 AM
Tootler 08 Jul 10 - 04:17 AM
The Fooles Troupe 08 Jul 10 - 06:18 AM
The Fooles Troupe 08 Jul 10 - 06:22 AM
The Fooles Troupe 08 Jul 10 - 10:12 AM
Tootler 08 Jul 10 - 11:56 AM
The Fooles Troupe 08 Jul 10 - 07:38 PM
Tootler 09 Jul 10 - 04:35 AM
pavane 09 Jul 10 - 04:43 AM
The Fooles Troupe 09 Jul 10 - 05:54 AM
Tootler 09 Jul 10 - 01:22 PM
The Fooles Troupe 09 Jul 10 - 10:12 PM
The Fooles Troupe 12 Jul 10 - 02:02 AM
Tootler 12 Jul 10 - 07:55 PM
The Fooles Troupe 12 Jul 10 - 08:40 PM
The Fooles Troupe 12 Jul 10 - 08:47 PM
Tootler 13 Jul 10 - 07:26 AM
The Fooles Troupe 13 Jul 10 - 07:46 AM
pavane 13 Jul 10 - 08:30 AM
Tootler 13 Jul 10 - 06:35 PM
Share Thread
more
Lyrics & Knowledge Search [Advanced]
DT  Forum Child
Sort (Forum) by:relevance date
DT Lyrics:





Subject: Tech: Playing Midi Files on Linux
From: The Fooles Troupe
Date: 07 Jul 10 - 08:19 PM

I am trying to get midi (.mid) to work on Ubuntu 10 - defaults to Pulse Audio interface (I can add other interfaces if needed). Have found many alleged players and have many music players installed. Doesn't seem to link in though...

Any assistance from the experienced?

Robin (2nd try - previous attempt disappeared!)


Post - Top - Home - Printer Friendly - Translate

Subject: RE: Tech: Playing Midi Files on Linux
From: Tangledwood
Date: 07 Jul 10 - 10:29 PM

SynthFont might be an overkill as just a simple player, but I find it useful running on windows XP. According to their forum it will run on Linux - there's reference to using "wine" if that means anything to you. Synthfont


Post - Top - Home - Printer Friendly - Translate

Subject: RE: Tech: Playing Midi Files on Linux
From: The Fooles Troupe
Date: 08 Jul 10 - 01:36 AM

Wine is an emulation package - so it will run slower and bog the system down ...

Most of my players seem to be Winamp compatible...


Post - Top - Home - Printer Friendly - Translate

Subject: RE: Tech: Playing Midi Files on Linux
From: pavane
Date: 08 Jul 10 - 03:17 AM

I hardly think that playing MIDI files is CPU-intensive if there is a sound card in the hardware - it just has to send on and off messages for notes a few times a second.
More work needed if the sound is synthesised by the CPU, though, I agree, but even then the highest frequency to be produced is thousands of times lower than the clock frequency of a modern chip.


Post - Top - Home - Printer Friendly - Translate

Subject: RE: Tech: Playing Midi Files on Linux
From: Tootler
Date: 08 Jul 10 - 04:17 AM

On my system, midi files play back with the Totem Movie player which, despite its name seems to be a general purpose player. It's been working since 8.10. You will need to install Ubuntu restricted extras to make it work though, IIRC.

You may well also have to install a software synthesiser. There are two available for Linux, Timidity++ and Fluidsynth. Most people seem to use Timidity, but I use Fluidsynth which seems to be a bit less hassle to set up. You will need to download a sound font to make either work.

I am not on my regular computer just now. I am typing this on my netbook which runs a different flavour of Linux, but I will check later on this morning and get back to you.


Post - Top - Home - Printer Friendly - Translate

Subject: RE: Tech: Playing Midi Files on Linux
From: The Fooles Troupe
Date: 08 Jul 10 - 06:18 AM

"hardly think that playing MIDI files is CPU-intensive"

But playing Windoze SW under Linux emulation code adds extra layers of computing.

I'm loading Fluid synth atm, thanks - will see how that goes...


Post - Top - Home - Printer Friendly - Translate

Subject: RE: Tech: Playing Midi Files on Linux
From: The Fooles Troupe
Date: 08 Jul 10 - 06:22 AM

I already had Timidity installed, but obviously it was not hooked in properly... neither one is listed in the apps menu...


Post - Top - Home - Printer Friendly - Translate

Subject: RE: Tech: Playing Midi Files on Linux
From: The Fooles Troupe
Date: 08 Jul 10 - 10:12 AM

OK - now after some updates went thru - Timidity works and plays midis! :-)


Post - Top - Home - Printer Friendly - Translate

Subject: RE: Tech: Playing Midi Files on Linux
From: Tootler
Date: 08 Jul 10 - 11:56 AM

I take it from that, you have a player working as well?


Post - Top - Home - Printer Friendly - Translate

Subject: RE: Tech: Playing Midi Files on Linux
From: The Fooles Troupe
Date: 08 Jul 10 - 07:38 PM

Yep, Timidity does it all (even has its own Sound font files for virtual devices) - it IS the player. Has all the midi player hooks too, Chorus, Reverb, etc. Just wanted to listen to Blind Mary quickly. Now I can easily and rapidly check out the Cat's collection, instead of all the mucking about in the past.... :-)

Even now appears in the apps lists, and is now the default app when midis are clicked. Even plays .MOD files too for those who want them.

Worked fine after that 'update' went thru... :-O

Aqualung is a 'gapless' audio player, btw, for those who want such a thing....


Post - Top - Home - Printer Friendly - Translate

Subject: RE: Tech: Playing Midi Files on Linux
From: Tootler
Date: 09 Jul 10 - 04:35 AM

Sounds useful. I might investigate it as I have been having problems with fluidsynth since upgrading to 10.04.

By the way, you are mistaken about Wine. It is not, strictly speaking, an emulator. Rather it handles Windows system calls directly using its own software rather than passing them through to a copy of Windows so you don't need to have Windows installed. The differences are explained here.

I have a few apps installed under Wine and they work fine and only one, Irfan View, is obviously slower than on Windows. Even so, it is very useful to have it readily available as it is such a useful format converter for images.

Not all Windows apps work well in Wine and for that reason, I have retained a dual boot system with a minimal Windows installation for those packages that do not work well with Wine. I suspect there are a lot of other Linux users in a similar situation. By paring back my Windows system to a minimum, it means boot times are acceptable if I do have to switch to Windows. I also use Panda Cloud AV to avoid all the delays with AV updates, especially if you only use Windows occasionally, though there are still the Windows updates that have to be installed from time to time.

If you have a useful Windows app, then it is worth installing Wine, but check first if there are problems with it. Wine maintain an application database here.

Wine home page is here.


Post - Top - Home - Printer Friendly - Translate

Subject: RE: Tech: Playing Midi Files on Linux
From: pavane
Date: 09 Jul 10 - 04:43 AM

Wine DOES stand for "WINE is not (an) Emulator", after all!

I will have to try running my program HARMONY under WINE at some time, and if it doesn't work, maybe I can created a cut-down version which does.

I am paqrticularly worried about whether the externally supplied OCX files used for directly driving the MIDI sounds will run under WINE.


Post - Top - Home - Printer Friendly - Translate

Subject: RE: Tech: Playing Midi Files on Linux
From: The Fooles Troupe
Date: 09 Jul 10 - 05:54 AM

WINE is an OS emulator - just not a CPU emulator - as someone with Uni study in IT.... :-) there IS a difference :-P

Virtually none of the old Win/DOS games I used to love work under WINE as of a couple of months ago...

As an Irfanview fan - must try that...

"whether the externally supplied OCX files used for directly driving the MIDI sounds will run under WINE. "

I wouldn't bother - if they don't you may actually just find it easier to run the midi stuff under a Linux thingie that works - such as Timidity... of course you will have to modify your program somewhat... by piping the output thru it...


Post - Top - Home - Printer Friendly - Translate

Subject: RE: Tech: Playing Midi Files on Linux
From: Tootler
Date: 09 Jul 10 - 01:22 PM

Pavane,

The best thing to do is to try your programme with Wine. If it works, then great. If not, then you need to decide whether you want to devote the effort to making it work in Linux using Wine.

The two programs I use under Wine both use the midi mapper to output midi. If you do, I would imagine it should work. There may be other issues, though.

If you get it working properly with Wine, then my guess is that it should still work OK with Windows.

As a thought, I was checking out Picasa the other day and they have a Linux version. When I looked into it, all they have done is to bundle the Windows version with Wine so they really only need to maintain one version to work on both Windows and Linux. They have also added a script to put the program launcher into the regular Linux application menu on the desktop so you don't have to go searching in the Wine menu for it.


Post - Top - Home - Printer Friendly - Translate

Subject: RE: Tech: Playing Midi Files on Linux
From: The Fooles Troupe
Date: 09 Jul 10 - 10:12 PM

Yes, you can use the midi mapper in linux to switch the midi data output, then the linux program that is the default midi player - in my case Timidity - will just pick it up, or you may need to help it find the output.

This is assuming that the midi files you are writing are really 'standard' and will play without conversion, and not some MicroCrap Frankenstein creation.... :-(

Once you get this to work, write it down, then you should be able to tell all future Linux users of any tweaks that are needed.


Post - Top - Home - Printer Friendly - Translate

Subject: RE: Tech: Playing Midi Files on Linux
From: The Fooles Troupe
Date: 12 Jul 10 - 02:02 AM

I can't get Fluidsynth to run sensibly at all - it keeps claiming that there is no sane JackD configuration....


Post - Top - Home - Printer Friendly - Translate

Subject: RE: Tech: Playing Midi Files on Linux
From: Tootler
Date: 12 Jul 10 - 07:55 PM

You have to force it to use alsa. This is the command I use from the terminal.

$ fluidsynth -C0 -R1 -l -a alsa /usr/share/sounds/sf2/Unison.SF2

  • -C0 and -R1 are for chorus and reverb. (1=on and 0=off)
  • -l to turn of lash. I am not sure what lash does, but on my system it wouldn't start up and the system disabled it after several goes. The synth seemed to run quite happily without it.
  • -a forces alsa so Jack doesn't try to start.
  • /usr/share/sounds/sf2/Unison.SF2 is the full path to the soundfont I use. I find the Unison soundfont a good general purpose one.

I have never quite found out what Jack does except that it is supposed somehow to reduce latency, nor have I ever been able to get it to start up properly. It has not affected me in any way so I just leave it alone. I think it might be important if you are trying to control a synth live and in real time.

I have a shell script which I can run by clicking on it in Nautilus and selecting "Run in terminal". You have to leave the terminal on while using it and then quit when you have finished as it takes over the audio system.

If you are using the Qsynth GUI, you first have to start it from the terminal using the command

$ qsynth -a

that forces it to start with alsa. You can then change the settings using the GUI to get it to use alsa in future rather than jack and also any other settings. Once you have done this, you can run it from the Applications menu or a desktop or panel launcher according to preference. I gave up on Qsynth, I find it just as easy to run it from the shell script.

If you just want simple playback of midi files to hear them, then try Movie Player. Right click on a midi file and select "Open With" from the menu then select Movie Player. The first time, it should tell you it needs to install some other software (ubuntu restricted extras, plus possibly some extra libraries - I can't remember now, it was some time back), so accept that and let it install the software. You may get some dire warnings about patent/copyright infringments. OK those (depending on your local legislation) and carry on. You should then be able to play back your midi files. At least it did for me. Totem Movie Player is a pretty basic player, but for me it works and it is useful because it plays a wide variety of formats both audio and video. The only real downside I have found is that it doesn't seem to recognise 16:9 videos and forces them into 4:3 so everything is somewhat lean looking. I prefer the VLC player for more serious use.


Post - Top - Home - Printer Friendly - Translate

Subject: RE: Tech: Playing Midi Files on Linux
From: The Fooles Troupe
Date: 12 Jul 10 - 08:40 PM

Actually Qsynth all works PERFECTLY fine when I run as root ... but that's bloody dangerous, especially when hooked live to the net... :-)

Jack is a clever attempt to provide a virtual jack patch board and can be very useful (multiple outputs from a single input, patching effects processors back and forth, etc) - it helps to run jackd - the jack demon - in the background but jack/qsynth wants to run as a real time scheduling app - which can preclude 'nornmal' Linux scheduling - unless you have a specific dedicated box just for your synth.

Maybe some su commands (to run the package safely as root) are needed somewhere ... :-)

Movie Player (this version) did not link to or suggest what was needed - so I will have to look around... a brief search thru the install library revealed nothing obvious.


But I can happily play midi files (as per Mudcat ones here) just thru Timidity - no need for a full synth for that :-)


Post - Top - Home - Printer Friendly - Translate

Subject: RE: Tech: Playing Midi Files on Linux
From: The Fooles Troupe
Date: 12 Jul 10 - 08:47 PM

LASH - Linux Audio Session Handler for jack and also apps - also a controlling GUI is available. the Qsynth GUI would probably work without need for the Lash gui if it is all hooked up ok.

VLC is my preferred media player, but I know of no VLC midi plugin.


Post - Top - Home - Printer Friendly - Translate

Subject: RE: Tech: Playing Midi Files on Linux
From: Tootler
Date: 13 Jul 10 - 07:26 AM

If you have timidity running OK, you don't need fluidsynth, but if you do want to use fluidsynth/qsynth, DON'T run qsynth as root. There is no need for Jack or lash, so run qsynth from terminal as I suggested (no need to run it as root) and edit the settings to use alsa and it will then run fine from the applications menu.


Post - Top - Home - Printer Friendly - Translate

Subject: RE: Tech: Playing Midi Files on Linux
From: The Fooles Troupe
Date: 13 Jul 10 - 07:46 AM

There are versions of Timidity for Windows
~~~~~~~~~~
http://timidity.sourceforge.net/

TiMidity++ Windows Synthesizer (TWSYNTH) is a extended version of TiMidity++. If you use this with a MIDI loopback device, you can get High Quality MIDI sounds with your favorite sequencer player ....etc.

also
    timidity.dll by PT2K
    TiMidity++ DLL wrapper (Japanese).
also
    TiMidity++ Experimental by Saito2
    Windows GUI version and MinGW command line version are available.
also
WinUMP by skeishi
    UMP for Windows platform (Japanese).
~~~~~~~~~~~


useful

Three Steps to MIDI on Linux -
http://www.linuxquestions.org/linux/answers/Applications_GUI_Multimedia/Three_Steps_to_MIDI_on_Linux

The TiMidity Howto - Using TiMidity as the ALSA sequencer client -
http://lau.linuxaudio.org/TiMidity-howto.html


Post - Top - Home - Printer Friendly - Translate

Subject: RE: Tech: Playing Midi Files on Linux
From: pavane
Date: 13 Jul 10 - 08:30 AM

The OCX in my program is not used for playing the complete MIDI files (I think), but is used for directly playing individial notes and chords. I won't be able to look at the code until tonight, but I think I use calls to the standard Windows MMI (Multi Media interface) to play complete files.

So I don't really understand why this doesn't work in WINE.


Post - Top - Home - Printer Friendly - Translate

Subject: RE: Tech: Playing Midi Files on Linux
From: Tootler
Date: 13 Jul 10 - 06:35 PM

Pavane,

I think your reply above may have been meant for the Harmony on Mac & Linux thread so I have taken the liberty of copying it there.

Cheers


Post - Top - Home - Printer Friendly - Translate
  Share Thread:
More...

Reply to Thread
Subject:  Help
From:
Preview   Automatic Linebreaks   Make a link ("blue clicky")


Mudcat time: 18 April 9:34 PM EDT

[ Home ]

All original material is copyright © 2022 by the Mudcat Café Music Foundation. All photos, music, images, etc. are copyright © by their rightful owners. Every effort is taken to attribute appropriate copyright to images, content, music, etc. We are not a copyright resource.