WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Timidity++ revisited  (Read 6980 times)

Offline s4brains

  • Newbie
  • *
  • Posts: 13
Timidity++ revisited
« on: May 04, 2013, 06:27:39 PM »
Howdy!

While Juanito did the TCL community a great service by making the original timidity.tcz extension available, it contains only the GTk+ interface and does not contain the xaw interface.

My thinking is that xaw could also be used as long as the "neXtaw.tcz" extension was installed.  Would anyone be willing to attempt to compile timidity again to include the xaw interface and test this? 

The xaw interface is superior to the GTk+ interface in features and looks and maintains an internal playlist from one application launch to the next launch.

On a similar note, would it also be worthwhile to provide "timidity-interfaces-extra_2.13.2-37" as a companion extension for timidity?



Best Regards,

s4



p.s. I get great midi sound from either desktops or laptops using "yamaha_xg_sound_set_re-map.sf2" (3.6 MB) and "Drums_By_Slavo_v1.0.sf2" (7.2 MB) soundfonts in unison.  "Drums_By_Slavo_v1.0.sf2" is listed last in timidity.cfg (the last listing gives that soundfont the highest preference.)

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14516
Re: Timidity++ revisited
« Reply #1 on: May 04, 2013, 09:46:52 PM »
My thinking is that xaw could also be used as long as the "neXtaw.tcz" extension was installed.

From: http://siag.nu/neXtaw/usage.shtml

Quote
This is not a magic library which will beautify all your apps instantly. But with some .Xdefaults fiddling you can make Athena applications look, and sometimes behave, much better.

You can make Athena based applications use it by the following ways:

    Just replace libXaw.* or libXaw3d.* with libneXtaw.so.?.? and make all symlinks that were pointing to libXaw point to libneXtaw
    ===> Note that this may not work in some cases. <===
    Relink the applications changing -lXaw to -lneXtaw (preferable, but not ever feasible). So you can still have the old libXaw and use it with some app that doesn't work with neXtaw.
    On Linux and Solaris, run the application with LD_PRELOAD set, like this:

            LD_PRELOAD=/usr/X11R6/lib/libneXtaw.so <program>

Whether it can be used as a drop-in replacement or not depends on the application. If it contains widgets that are subclassed from Xaw widgets, it probably won't work and relinking will be necessary - that is the case for any Xaw replacement library.

I'm not sure that this is so straightforward...

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14516
Re: Timidity++ revisited
« Reply #2 on: May 04, 2013, 11:09:39 PM »
The timidity extension was compiled without xaw enabled.

If I enable xaw, then compiling timidity fails - this is a known bug (from 2005), but the patch to fix it is no longer available at the link referenced in the bug report

http://www.mail-archive.com/debian-bugs-rc@lists.debian.org/msg22827.html

..and BTW, timidity looks for libXaw and not libneXtaw

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14516
Re: Timidity++ revisited
« Reply #3 on: May 05, 2013, 04:31:38 AM »
I compiled timidity from git - it seems the patch to fix xaw and one to link to neXtaw are included.

I'll pm you with a link to download and test

Offline s4brains

  • Newbie
  • *
  • Posts: 13
Re: Timidity++ revisited
« Reply #4 on: May 05, 2013, 11:53:29 AM »
Juanito,

I suspect that I misled you into believing that I am a savvy Linux user.  I am not savvy with Linux and have only recently become acquainted with TCL.

I am running TCL version 4.5.5 and as near as I can tell I had gtk1 and gtk2 installed prior to my beginning this discussion.  I installed neXtaw.tcz in order to test your experimental compile.

These are my observations:

1) The gtk interface no longer works.  I suspect that you compiled using a switch for gtk+ since I erroneously mentioned gtk+ earlier in this discussion.  If I try to run timidity from the command line as "timidity ig &" I receive an error and one time TCL actually hung, requiring a "hard" power down.  I don't know if gtk+ is even available for my version of TCL.  I don't see it listed in the apps from the online repository.  If you remember your original gtk compiler switch option from your first release that would be preferable to me because that one worked for me, and I'm really not interested in upgrading to a newer version of gtk.

2) There is good news about the xaw interface.  When I attempt to run timidity from the command line as "timidity ia &"  it works perfectly.  I was initially surprised by the "looks" of the interface because my familiarity with running timidity using this interface stems from limited experience with Ubuntu 10.04. The libraries supplying xaw for Ubuntu are quite different from neXtaw, though.

3) I do believe the xaw interface to be superior and it can create a ".xtimidity" file in the user's home directory where a number of configuration options are stored along with a playlist.  I believe that to create the .xtimidity file the user is required to select a "Save Config" option under the "File" menu while timidity is open.

4) The xaw interface contains a number of configuration options which are not available with the gtk interface.  Selecting "Extend Modes" from the "file" menu lists different playback enhancement choices along with choices for different output devices.  Among the available options for output device are "dsp device" and "ALSA pcm device".  Although I have "libasound.tcz" installed, I am using the "oss" soundsystem and do not have ALSA installed so if I attempt to select ALSA I receive an error about not being able to find "asound.conf" or some such similar message.  Selecting "dsp device" works fine, though.

4)  I don't know if you are willing to compile again, but if not, I would be happy with this version as soon as I learn how to change the command that starts it from the "right click" apps menu and from "wbar".

Thank you very much!

Best Regards,

s4

Offline tinypoodle

  • Hero Member
  • *****
  • Posts: 3857
Re: Timidity++ revisited
« Reply #5 on: May 05, 2013, 07:53:19 PM »
You might want to install OSS_alsa.tcz for alsa emulation.
"Software gets slower faster than hardware gets faster." Niklaus Wirth - A Plea for Lean Software (1995)

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14516
Re: Timidity++ revisited
« Reply #6 on: May 05, 2013, 08:32:54 PM »
The gtk interface no longer works.  I suspect that you compiled using a switch for gtk+ since I erroneously mentioned gtk+ earlier in this discussion.  If I try to run timidity from the command line as "timidity ig &" I receive an error
I didn't change the way timidity was compiled for gtk1 - as long as the gtk1 extension was loaded, it should have worked - could you cut and paste the error message you got please?

Quote
Among the available options for output device are "dsp device" and "ALSA pcm device".  Although I have "libasound.tcz" installed, I am using the "oss" soundsystem and do not have ALSA installed so if I attempt to select ALSA I receive an error about not being able to find "asound.conf" or some such similar message.  Selecting "dsp device" works fine, though.
If you're using oss, you only need the libasound extension loaded (there's no need for the alsa extension) - this is compiled in so users have the choice of alsa or oss

Quote
I don't know if you are willing to compile again, but if not, I would be happy with this version as soon as I learn how to change the command that starts it from the "right click" apps menu and from "wbar".
Once things are confirmed working, I can add menu items for gtk1 and neXtaw

Offline s4brains

  • Newbie
  • *
  • Posts: 13
Re: Timidity++ revisited
« Reply #7 on: May 05, 2013, 09:01:04 PM »
Juanito,

The error message I receive when attempting to launch from the command line in a terminal with "timidity -ig &" is this:

 "CONNECTION PROBLEM WITH Gtk+ PROCESS IN PIPE_INT_READ BECAUSE:Success"

The process appears to "hang" at that point and the only thing I can do is enter "Control- C" or press "enter" to terminate the process.

I saw at least one other message during the course of my experimentation but I think that was when I was using the xaw interface.  I don't know how to repeat the situation which caused that error, but to the best of my memory that error said something about invalid characters compiled into the file.  I saw that error only one time and it didn't appear to interfere with performance.

Oh, and this is insignificant, but the icon tooltips for the action buttons in the xaw interface do not appear even though the ".xtimidity" file setting is "set Tooltips 1".  Just in case there might be reverse logic I temporarily edited the file and tried a setting of "0" but that did not make any difference.

If I understood you correctly you are contemplating a *.tcz release with menu options for both the gtk interface and the xaw interface.  I am going to try to attach a *.png to this message which is the image that I used for the "timidity(xaw).desktop" command I created.  Use or discard the image as you see fit.

Thank you again!

Regards,

s4
« Last Edit: May 05, 2013, 09:08:47 PM by s4brains »

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14516
Re: Timidity++ revisited
« Reply #8 on: May 05, 2013, 11:52:07 PM »
Here's what I get:
Code: [Select]
$ timidity -ig &
Unison.sf2: line 1: syntax error
Unison.sf2: line 2: Must specify tone bank or drum set before assignment
Unison.sf2: line 3: Must specify tone bank or drum set before assignment
Unison.sf2: line 4: syntax error
...
Unison.sf2: line 10: syntax error
Too many errors... Give up read Unison.sf2
timidity: Can't read any configuration file.
Please check /usr/local/share/timidity/timidity.cfg

where:
Code: [Select]
$ cat /usr/local/share/timidity/timidity.cfg
# example config
dir /usr/local/share/timidity/soundfonts
source Unison.sf2
#
#dir /usr/local/share/timidity/eawpats
#source gravis.cfg
#source gsdrums.cfg
#source gssfx.cfg
#source xgmap2.cfg
#
#EOF

..the main problem being that I have no clue what I'm doing - you'll need to supply me with the appropriate sound fonts and configuration files in order to test further.

BTW, I see that both gtk1 and neXtaw need to be present to be able to use either interface.

For the icon, there can be only one icon executing either "-ig" or "-ia", but there can be one menu item per command.

Edit: updated test extension posted at the same url I sent in the pm earlier
« Last Edit: May 06, 2013, 12:01:24 AM by Juanito »

Offline s4brains

  • Newbie
  • *
  • Posts: 13
Re: Timidity++ revisited
« Reply #9 on: May 06, 2013, 08:48:11 AM »
Juanito,

The same problem still exists with the gtk interface and it gives the same error.

The xaw interface still works fine.

I don't understand your comments about the icons.  I presumed that you were going to create (2) distinct *.desktop menu entries each with different prefix names.  Each *.desktop menu entry could also have a different icon and provide a different wbar name hint.  The user could disable one of the wbar entries if desired.  For example you could use "timidity-(gtkUI).desktop" and "timidity-(xawUI).desktop".

The "timidity.cfg" file which you are attempting to use is probably not a good candidate when TCL is the operating system because it would require the user to create a "/usr/share/timidity/soundfonts" directory which contained any soundfonts referenced in the "timidity.cfg" file.  This new "soundfonts" folder would also need to be added to the ".filetool.lst" file so that it would be saved and restored during shutdown and reboot.

I have attached a simpler "timidity.cfg" file which I believe is more appropriate for a TCL environment.  I cannot attach files as large as even a small soundfont file to a message on this forum, so that is not an option.

Please examine my timidity.cfg file and make note of the "dir "/home/tc/Midis"" line as it serves as a pointer to timidity of where to locate soundfont files.

You could create a "Midis" directory under /home/tc and put any soundfonts which you have available in it provided you edit my timidity.cfg file to supply the correct name for the soundfont and delete the other soundfont reference.

Also keep in mind that the soundfont files and soundfont directory must be preserved during shutdown and reboot.  It is in the user's best interest to use a small soundfont(s) to minimize the effort to gzip the user's home directory during shutdown.

You could also use any of the TCL soundfonts supplied in *.tcz format as long as you change the "dir /usr/local/share/timidity/soundfonts" line to point timidity to the appropriate folder.

Please also realize that at the very least "usr/local/share/timidity/timidity.cfg" must be added to "filetool.lst"

I think my soundfont files can be found with a Google search, but mine were chosen primarily because of the small footprint required to produce reasonably sounding midi playback.

If you are willing to supply me with an FTP address with write priviledges, I think I could send you my actual soundfont files but perhaps that would be a waste of your time and mine because any soundfont(s) will work for testing purposes.

I hope that I have not frustrated you to a great extent.


Best Regards,

s4
« Last Edit: May 06, 2013, 08:50:31 AM by s4brains »

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14516
Re: Timidity++ revisited
« Reply #10 on: May 06, 2013, 09:19:46 AM »
OK, I see the problem now:
Code: [Select]
$ timidity -ig
Terminated sig=0x0d
CONNECTION PROBLEM WITH Gtk+ PROCESS IN PIPE_INT_WRITE BECAUSE:Broken pipe
Both gtk1 and timidity are ancient, so I'm not too sure there's going to be an easy solution to this - I could recompile with only the neXtaw interface enabled, what do you think?

Offline s4brains

  • Newbie
  • *
  • Posts: 13
Re: Timidity++ revisited
« Reply #11 on: May 06, 2013, 09:58:44 AM »
Hmm.

Actually, it is your decision to make.  You are the one doing all the work!

I had hoped it was something as simple as the possibility that you had compiled on a platform with gtk3 installed and that somehow inadvertently created a dependence on gtk3.  I was going to try to create a TCL image with gtk3 to test this hypothesis when I had more time.  (My existing USB stick is so full that I can't add gtk3 to it.)

Personally, I never use the gtk interface for timidity on my Ubuntu platforms even though it works there.

However, Athena Widgets are even older than gtk and some people might object to an xaw dependency reguirement, even though neXtaw.tcz is very small.

How about waiting for a bit to see if anyone else has an opinion before compiling again?

Your original release does work, it just lacks the xaw interface which I greatly prefer over the gtk interface.

At this point you could could also simply offer separate *.tcz extension packages for each of the different timidity interfaces.


s4
« Last Edit: May 06, 2013, 10:11:42 AM by s4brains »

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 10957
Re: Timidity++ revisited
« Reply #12 on: May 06, 2013, 10:30:08 AM »
Is nextaw required? The standard Xaw is a part of Xorg-libs, which would be less of an added dep.
The only barriers that can stop you are the ones you create yourself.

Offline s4brains

  • Newbie
  • *
  • Posts: 13
Re: Timidity++ revisited
« Reply #13 on: May 06, 2013, 11:11:35 AM »
Quote from: curaga

Is nextaw required? The standard Xaw is a part of Xorg-libs, which would be less of an added dep.


Good Point!  When I originally searched for xaw the only mention I found of it was in neXtaw.  In order to test a recompile would be required on a platform with only Xorg-libs would be required.  The sample timidity.tcz extensions I have examined specifically require neXtaw.tcz.

edit follows:
I going to show how ignorant I am and suggest that somehow linking to libneXtaw.so also creates the problem with the gtk interface.
« Last Edit: May 06, 2013, 11:54:00 AM by s4brains »

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14516
Re: Timidity++ revisited
« Reply #14 on: May 06, 2013, 09:38:24 PM »
If you're happy with the xaw interface, then it would make sense to compile timidity with only the xaw interface since this would remove the dependency on gtk1 and neXtaw.