Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Thu 18 Sep 2014, 11:49
All times are UTC - 4
 Forum index » Advanced Topics » Additional Software (PETs, n' stuff) » Multimedia
TiMidity++-2.13.0, with alsaseq support!
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 4 [57 Posts]   Goto page: 1, 2, 3, 4 Next
Author Message
Pizzasgood


Joined: 04 May 2005
Posts: 6270
Location: Knoxville, TN, USA

PostPosted: Mon 18 Aug 2008, 23:36    Post subject:  TiMidity++-2.13.0, with alsaseq support!
Subject description: Only tested in Puppy 4.00
 

TiMidity++-2.13.0.pet
eawpatches.pet <-- optional higher quality sound patches (37 MB decompressed)

TiMidity++ is a softsynth. It takes in a MIDI file, then uses a sound font or sound patch to transform it into normal audio. You can use it to convert MIDI files directly into the WAV format, or you can use it to play the file through the speakers. Another things it can do (the most useful IMHO) is run as a daemon to give you an Alsa port for MIDI playback. This lets all those other audio programs that normally play MIDI files through a port to use Timidity instead. In my case, I use it to let me play MIDI files from Audacious (using the Amidi-plug plugin). I believe it should also work with Rosegarden (a sequencer). The aplaymidi program can also use it. Basically it mimics what would happen if you had and properly configured a soundcard which is MIDI capible. This uses more CPU power than letting the card do it though. Not a huge amount - modern PCs should handle it fine - but if you're also doing some heavy lifting in other programs it could probably get pretty choppy (renicing it to a higher priority should help).

Note: When I compiled this, I didn't enable any interactive interfaces except for ncurses. If playing files with Timidity directly, you can either use it with no interface:
Code:
timidity /path/to/my/midi_file.mid

or you can use ncurses like this:
Code:
timidity -in /path/to/my/midi_file.mid


The best deal though, is to set it up as a daemon to create that Alsa port, then get your normal audio player to send MIDI through that. I don't know if you can do it with Gxine, but I think you can with Mplayer. I know you can with XMMS and Audacious. I just uploaded a version of Audacious with a working 'Amidi-plug' plugin over here. For XMMS you're on your own, but I think there are both 'Amidi-plug' and 'Timidity' plugins, either of which should be fine. The Audacious package I linked to is already configured to use this.

So, how to set Timidity up this way? Easy. I added a script at /etc/init.d/timidity_server to do it automatically at every boot. If you want to disable it, just remove the executable bit on that script (chmod 644 /etc/init.d/timidity_server to remove, and chmod 755 /etc/init.d/timidity_server to make it executable again). There's one catch: when you first install this the daemon won't be started automatically until you reboot. To start it by hand just run this:
Code:
/etc/init.d/timidity_server start



I mentioned that it uses a sound font or sound patch to make the audio from the MIDI file. Sound patches are a bunch of samples of audio from different instruments and what not that Timidity will transform appropriately to match the note which is supposed to be played. Sound fonts are essentially a group of patches combined into a single file, but not as simple as that. They also support more features than patches.

Sound fonts and patch collections can be quite large (up in the 70 megabytes or more). Because we are puppians, I tracked down and included a "very small" (~4 mb) collection put together by Shom. (Shom's TiMidity++ page)

For those who'd like better quality, I also made a package of the ~30 mb 'eawpatches' collection from Gentoo. When installed it will automatically set itself as the default To revert to 'minishom', go to /usr/share/timidity/ and symlink 'minishom/' to 'current/'.

Note: if you are using it as a daemon for Alsa, you'll have to restart it before a change in patches will take effect. The hard way is to reboot. The easy way is /etc/init.d/timidity_server restart


Configuring Timidity to use any old patch or font you download is an exercise left to the reader. I did simplify things a little by setting up Timidity to look in /usr/share/timidity/current/timidity.cfg for the data, where the 'current' directory is actually a symlink. This way you can have multiple sound fonts / patch collections each in their own director of /usr/share/timidity (or elswhere and symlinked in, to save space in the savefile in case you use large ones). Within each directory you'll want to set up a 'timidity.cfg' file to use whatever fonts or patches you put in it. Then to switch, just change where the 'current' directory points. And as above, if you're using it as a daemon you'll need to restart it before the change takes effect.

_________________
Between depriving a man of one hour from his life and depriving him of his life there exists only a difference of degree. --Muad'Dib

Back to top
View user's profile Send private message Visit poster's website 
zigbert


Joined: 29 Mar 2006
Posts: 5723
Location: Valåmoen, Norway

PostPosted: Tue 19 Aug 2008, 17:47    Post subject:  

This is really great!!! Only half the size of the official version. Thank you Pizzagood!

If you want to use a sf2 soundfont, is all very simple. Add the soundfont to /usr/share/timidity/timidity.cfg. In my attached example of timidity.cfg, The fluidR3_GM is first loaded, then the additions for GS - fluidR3_GS. Then, to get the best piano, the steinberg soundfont will override piano sounds from fluidR3.
Code:
dir /usr/share/timidity
dir ~/.timidity
soundfont /mnt/sda6/puppy/lyd/soundfonts/FluidR3_GM.sf2
soundfont /mnt/sda6/puppy/lyd/soundfonts/FluidR3_GS.sf2
soundfont /mnt/sda6/puppy/lyd/soundfonts/WST25FSteinberg_Piano-00Sep22.sf2

Remember that timidity also supports *.kar files. These are midi files with text info for karaoke.

Sigmund

_________________
Stardust resources
Back to top
View user's profile Send private message Visit poster's website 
bill

Joined: 28 May 2008
Posts: 495

PostPosted: Tue 19 Aug 2008, 19:39    Post subject: The stark dissapointment in dealing with midi.  

Thanks Pizzasgood and Zigbert for addressing these midi problems I have been saddled with for several weeks.Obviously I am not the only newbie who didn't know whether to scratch his watch or wind his arse Laughing when it came to getting sound from Rosegarden ,timidity ,Qtractor and several others.Seems I read where another newbie quoted said "I have completely given up trying to get a decent home studio operational in Linux" I suppose he went back to brandx.I can't say I have done as you suggested yet but at least now I have some directions to try.Thanks,bill
Back to top
View user's profile Send private message 
bill

Joined: 28 May 2008
Posts: 495

PostPosted: Wed 20 Aug 2008, 07:56    Post subject: What is and what creates /timidity_server ?  

Hi men,In a preliminary foray in trying to understand how to use your gracious information ,I typed this in on the console.

#chmod 755 /etc/init.d/timidity_server and I get this in return:

# chmod 755 /etc/init.d/timidity_server
chmod: cannot access `/etc/init.d/timidity_server': No such file or directory

My question is ,What creates "timidity_server" is this just a open named file or directory ? and how do I create it ?

thanks,bill
Back to top
View user's profile Send private message 
Pizzasgood


Joined: 04 May 2005
Posts: 6270
Location: Knoxville, TN, USA

PostPosted: Wed 20 Aug 2008, 21:33    Post subject:  

It should come with the package I uploaded, which is also the only way to get that particular script since I wrote it myself. Also, it should already be executable, so you won't need to chmod it unless you change it to non-executable. The only step you should have to do manually after installing is:
Code:
/etc/init.d/timidity_server start

And that's optional - it will happen automatically after you reboot (assuming you haven't made the timidity_server script non-executable).


Pretty much all the script does is execute this command which I copied out of Gentoo:
Code:
timidity -iA -B2,8 -Os -EFreverb=0 &

It has some extra logic in there to let you stop or restart it without having to manually kill it, but nothing else. The above command should work with any timidity package, so long as alsa sequencer support was compiled in.

This is the './configure' line I used when compiling:
Code:
./configure --prefix=/usr --enable-server --enable-alsaseq --enable-ncurses --enable-audio=alsa,vorbis --enable-network


The '--enable-network' part lets us play midis hosted over a network. Like this:
Code:
timidity http://www.lynnemusic.com/midi/bjorn__lynne-_the_spooky_pumpkin_head.mid

_________________
Between depriving a man of one hour from his life and depriving him of his life there exists only a difference of degree. --Muad'Dib

Back to top
View user's profile Send private message Visit poster's website 
bill

Joined: 28 May 2008
Posts: 495

PostPosted: Thu 21 Aug 2008, 12:17    Post subject:  

Thanks alot Pizzasgood.Your above post has clarified some questions I had and also opened some other questions I have "Like exactly ,how do you want a application to work (me) Laughing I can't recall brandX ever allowing me to do setups as I wish they would work,and this "new choices" is something very foreign to my thinking. Rolling Eyes I realize of course there are many things I am required to learn and understand but with the help of more experienced users ,the answers are out there.thanks again for your time and effort.cheers,bill
Back to top
View user's profile Send private message 
ravensrest


Joined: 22 Feb 2008
Posts: 321
Location: Hood Canal, WA

PostPosted: Sat 08 Nov 2008, 13:23    Post subject: re: TiMidity++-2.13.0, with alsaseq support
Subject description: timidity converts *.mid to *.wav
 

Thanks a lot, pizzasgood. Your Timidity++ works fine, just wish I could find a plug-in for gxine. No luck there after massive searching.

One of the other things Timidity is great at is converting *.mid files to *.wav files. Simply use the command:


timidity input.mid -Ow -o output.wav


Of course substitute the correct full path and filenames for input.mid and output.wav.

If you want to do a whole directory full of midis, save this handy batch processor (I called it midi_batch) to that directory and run it from the command line:


#!/bin/sh
# For batch file conversion
# Find all files in a directory (-f for files, -d for directories to list)
# echo the file name
# use Timidity to convert from midi to flac (or wav)

for i in *
do
if [ -f $i ]
then
z=$i.wav
echo $i
echo $z
timidity $i -Ow -o $z
fi
done
exit 0


I did not write this: copied it from an anonymous posting on yoten.blogspot.com, but it works just fine!

BS
Back to top
View user's profile Send private message 
NickelZ

Joined: 18 Mar 2009
Posts: 5
Location: Christchurch, New Zealand

PostPosted: Tue 31 Mar 2009, 04:36    Post subject:    

Thank you for the "Timidity pet" Pizzasgood. It works well. I have used the file manager to browse to /usr/bin and dragged the timidity icon to the jwm desktop. Now I can drag and drop a midi file from my midi file directory and it instantly plays the file. I also changed the icon to one of my choice with a right click on the new desktop icon and changed the icon with a further drag and drop (as per the instruction balloon that popped up)

Regards,
Asus Eee PC user with puppy 4.20 "And loving it"
Back to top
View user's profile Send private message 
Pizzasgood


Joined: 04 May 2005
Posts: 6270
Location: Knoxville, TN, USA

PostPosted: Sat 04 Apr 2009, 02:41    Post subject:  

If you want to just click a .mid file to play it, you could right-click a .mid file, go to "file -> set run action", and set it to this:
Code:
timidity "$@"

Make sure the radio button above is set to "Only for the type `MIDI audio' (audio/midi)" so you don't change the setting for all audio files!

BTW, the desktop itself is created by ROX-Filer, not JWM. JWM just does the taskbar and the window decorations (titlebar and borders, but not scrollbars and such, which are usually GTK but could be other things (QT, TK, etc.)). I think in 4.2 JWM also handles those popout trays on the sides and top. Not sure.

_________________
Between depriving a man of one hour from his life and depriving him of his life there exists only a difference of degree. --Muad'Dib

Back to top
View user's profile Send private message Visit poster's website 
NickelZ

Joined: 18 Mar 2009
Posts: 5
Location: Christchurch, New Zealand

PostPosted: Tue 14 Apr 2009, 05:56    Post subject: right-click a .mid file, go to "file -> set run action...  

Thanks again pizzasgood. I have done that as well now to. Smile
Back to top
View user's profile Send private message 
charlie6


Joined: 30 Jun 2008
Posts: 1007
Location: South of Belgium

PostPosted: Fri 22 May 2009, 03:37    Post subject:  

Hi Pizzasgood,
Many thanks for timidity++-2.13.pet!
I installed it with PetGet, "all dependecies installed", restart the PC and got a menu entry under Multimedia.
Clicking on it got...nothing happening..?
Re-reading your post a saw:
Quote:
Note: When I compiled this, I didn't enable any interactive interfaces except for ncurses. If playing files with Timidity directly, you can either use it with no interface:

is that to say that there is no GUI?

How could I do to get one ... I remember (may be I am wrong.... that on timidity-2.13.pet there was one..? I uninstalled it before installing timidity++-2.13.pet)

Furthermore, how could timidity start automatically - as defaultmidiplayer - when clicking on a midifilekey found on a musicscore website (i.e. 8notes) to play it without loading it?

Many thanks for answering
Cheers
Charlie
Back to top
View user's profile Send private message 
vovchik


Joined: 23 Oct 2006
Posts: 1285
Location: Ukraine

PostPosted: Fri 22 May 2009, 04:23    Post subject:  

Dear charlie,

This is my version of Timidity that has a gui. Unpack and copy it into /usr/bin (first rename Pizzasgood's version timidity-org). Open a terminal and type timidity -ig. It should come up (GTK gui). Mine looks for config info in /etc and in /usr/share/timidity (timidity.cfg). To get timidity into your menu system, unpack the timidity desktop file and copy it into /usr/share/applications. Then, in a terminal, run fixmenus. After restarting your x server, timidity should appear in your multimedia menu as Timidity++. Good luck.

Hope this works for you....

With kind regards,
vovchik
TiMidity++.desktop.tar.gz
Description 
gz

 Download 
Filename  TiMidity++.desktop.tar.gz 
Filesize  362 Bytes 
Downloaded  867 Time(s) 
timidity-2.13.2.tar.gz
Description 
gz

 Download 
Filename  timidity-2.13.2.tar.gz 
Filesize  438.57 KB 
Downloaded  890 Time(s) 
Back to top
View user's profile Send private message 
zigbert


Joined: 29 Mar 2006
Posts: 5723
Location: Valåmoen, Norway

PostPosted: Fri 22 May 2009, 09:28    Post subject:  

Is the gui depending on tk?

Code:
# timidity -ig
timidity: error while loading shared libraries: libtk.so: cannot open shared object file: No such file or directory

_________________
Stardust resources
Back to top
View user's profile Send private message Visit poster's website 
vovchik


Joined: 23 Oct 2006
Posts: 1285
Location: Ukraine

PostPosted: Fri 22 May 2009, 10:52    Post subject:  

Dear Sigmund,

This version supports a number of interfaces:
Code:

Available interfaces (-i, --interface option):
  -in          ncurses interface
  -iT          vt100 interface
  -is          slang interface
  -im          motif interface
  -ik          Tcl/Tk interface
  -ie          Emacs interface (invoked from `M-x timidity')
  -ii          skin interface
  -ig          gtk+ interface
  -id          dumb interface
  -ir          remote interface
  -iA          ALSA sequencer interface


Here is my ldd dump:

Code:

        linux-gate.so.1 =>  (0xffffe000)
        libasound.so.2 => /usr/lib/libasound.so.2 (0xb7e8d000)
        libm.so.6 => /lib/libm.so.6 (0xb7e66000)
        libdl.so.2 => /lib/libdl.so.2 (0xb7e62000)
        libpthread.so.0 => /lib/libpthread.so.0 (0xb7e4b000)
        libtk.so => /usr/lib/libtk.so (0xb7d40000)
        libtcl.so => /usr/lib/libtcl.so (0xb7c52000)
        libXm.so.2 => /usr/lib/libXm.so.2 (0xb7ab7000)
        libXt.so.6 => /usr/X11R7/lib/libXt.so.6 (0xb7a68000)
        libSM.so.6 => /usr/lib/libSM.so.6 (0xb7a60000)
        libICE.so.6 => /usr/lib/libICE.so.6 (0xb7a48000)
        libXext.so.6 => /usr/lib/libXext.so.6 (0xb7a39000)
        libX11.so.6 => /usr/X11R7/lib/libX11.so.6 (0xb7951000)
        libartsc.so.0 => /usr/lib/libartsc.so.0 (0xb794b000)
        libgmodule-2.0.so.0 => /usr/lib/libgmodule-2.0.so.0 (0xb7948000)
        libgthread-2.0.so.0 => /usr/lib/libgthread-2.0.so.0 (0xb7944000)
        librt.so.1 => /lib/librt.so.1 (0xb793c000)
        libglib-2.0.so.0 => /usr/lib/libglib-2.0.so.0 (0xb78a8000)
        libesd.so.0 => /usr/lib/libesd.so.0 (0xb789f000)
        libaudiofile.so.0 => /usr/lib/libaudiofile.so.0 (0xb787a000)
        libao.so.2 => /usr/lib/libao.so.2 (0xb7876000)
        libFLAC.so.7 => /usr/lib/libFLAC.so.7 (0xb7835000)
        libOggFLAC.so.3 => /usr/lib/libOggFLAC.so.3 (0xb7823000)
        libncurses.so.5 => /lib/libncurses.so.5 (0xb77e1000)
        libslang.so.2 => /lib/libslang.so.2 (0xb7723000)
        libgtk-x11-2.0.so.0 => /usr/lib/libgtk-x11-2.0.so.0 (0xb73e2000)
        libgdk-x11-2.0.so.0 => /usr/lib/libgdk-x11-2.0.so.0 (0xb7360000)
        libatk-1.0.so.0 => /usr/lib/libatk-1.0.so.0 (0xb7346000)
        libgdk_pixbuf-2.0.so.0 => /usr/lib/libgdk_pixbuf-2.0.so.0 (0xb7330000)
        libpangocairo-1.0.so.0 => /usr/lib/libpangocairo-1.0.so.0 (0xb7327000)
        libpango-1.0.so.0 => /usr/lib/libpango-1.0.so.0 (0xb72ea000)
        libcairo.so.2 => /usr/lib/libcairo.so.2 (0xb7274000)
        libgobject-2.0.so.0 => /usr/lib/libgobject-2.0.so.0 (0xb723b000)
        libjack.so.0 => /usr/lib/libjack.so.0 (0xb7223000)
        libvorbis.so.0 => /usr/lib/libvorbis.so.0 (0xb71fa000)
        libvorbisenc.so.2 => /usr/lib/libvorbisenc.so.2 (0x44e0e000)
        libogg.so.0 => /usr/lib/libogg.so.0 (0xb71f4000)
        libspeex.so.1 => /usr/lib/libspeex.so.1 (0xb71e0000)
        libc.so.6 => /lib/libc.so.6 (0xb709e000)
        /lib/ld-linux.so.2 (0xb7f42000)
        libXss.so.1 => /usr/lib/libXss.so.1 (0xb709b000)
        libXft.so.2 => /usr/lib/libXft.so.2 (0xb7088000)
        libfreetype.so.6 => /usr/lib/libfreetype.so.6 (0xb701b000)
        libfontconfig.so.1 => /usr/lib/libfontconfig.so.1 (0xb6ff0000)
        libXrender.so.1 => /usr/lib/libXrender.so.1 (0xb6fe8000)
        libXp.so.6 => /usr/X11R7/lib/libXp.so.6 (0xb6fe1000)
        libXau.so.6 => /usr/X11R7/lib/libXau.so.6 (0xb6fdd000)
        libxcb-xlib.so.0 => /usr/lib/libxcb-xlib.so.0 (0xb6fdb000)
        libxcb.so.1 => /usr/lib/libxcb.so.1 (0xb6fc4000)
        libXfixes.so.3 => /usr/X11R7/lib/libXfixes.so.3 (0xb6fbf000)
        libXinerama.so.1 => /usr/X11R7/lib/libXinerama.so.1 (0xb6fbc000)
        libXi.so.6 => /usr/X11R7/lib/libXi.so.6 (0xb6fb3000)
        libXrandr.so.2 => /usr/X11R7/lib/libXrandr.so.2 (0xb6fad000)
        libXcursor.so.1 => /usr/X11R7/lib/libXcursor.so.1 (0xb6fa4000)
        libpangoft2-1.0.so.0 => /usr/lib/libpangoft2-1.0.so.0 (0xb6f79000)
        libz.so.1 => /lib/libz.so.1 (0xb6f68000)
        libpng12.so.0 => /usr/lib/libpng12.so.0 (0xb6f2c000)
        libexpat.so.1 => /usr/lib/libexpat.so.1 (0xb6f0c000)
        libXdmcp.so.6 => /usr/X11R7/lib/libXdmcp.so.6 (0xb6f07000)


With kind regards,
vovchik
Back to top
View user's profile Send private message 
zigbert


Joined: 29 Mar 2006
Posts: 5723
Location: Valåmoen, Norway

PostPosted: Fri 22 May 2009, 11:09    Post subject:  

Thanks
Funny, - it won't start without libtk even though I'm not using the tk-gui

_________________
Stardust resources
Back to top
View user's profile Send private message Visit poster's website 
Display posts from previous:   Sort by:   
Page 1 of 4 [57 Posts]   Goto page: 1, 2, 3, 4 Next
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » Advanced Topics » Additional Software (PETs, n' stuff) » Multimedia
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.1212s ][ Queries: 13 (0.0051s) ][ GZIP on ]