Tux Guitar

Open Discussion

Subject MIDI playback?



Author Message
Me Gusta TuxGuitar
Post: Sep 5th 2006 at 3:00 PM

Hi Julian. I have been using you app for some time now...
I'm trying to get MIDI playback in GNU Solfege to work, but it wont work. In Solfege, you can choose to have MIDI playback from external apps, like timidity. I have MIDI playback in TuxGuitar (great app!=), and I just wonder what method you use for MIDI playback in TuxGuitar? Have you written you own MIDI player using Java? If yes, can you publish the player' sourcode, or maybe write a little standalone player like timidity using Java? That would help me and many of my friends a great deal.

Looking forward to hear from you.


Back to Top
 
Julian
Post: Sep 5th 2006 at 5:44 PM

Hi,
Java Sound Api has its own synthetizer, that why it doesn't need timidity to play sounds, though it does not have timidity's sound quality, as it can't load soundfonts. With JSA you can't connect directly to your native synthetizer neither (unless you implement your own synthetizer and create native calls with jni ).

The code used by tuxguitar to play sounds, was taken from this site:
http://www.jsresources.org/
There you will find many sample codes showing you how to play midi files.

>>>Me Gusta TuxGuitar
if you speak spanish.. please post in spanish..my english is no good...

Bye.


Back to Top
 
Me Gusta TuxGuitar
Post: Sep 9th 2006 at 8:56 AM

¡Hola Julian! Hablo español un poco, pero mi español esta mal, porquee soy de noruego. TuxGuitarra esta la programma mas fina por los tocan guitarra.
Gracias


Back to Top
 
Julian
Post: Sep 9th 2006 at 10:20 AM

Ok, don't worry.. speak in english.


Back to Top
 
KG
Post: Apr 19th 2007 at 12:59 PM

"With JSA you can't connect directly to your native synthetizer neither (unless you implement your own synthetizer and create native calls with jni )."

At least on Windows, Java Sound allows output to native MIDI devices. It would be very nice to allow the MIDI output device to be selected in TuxGuitar. I'll try to submit a patch for this.


Back to Top
 
Julian
Post: Apr 19th 2007 at 1:18 PM

Hi,
thats ready on CVS version.


Back to Top
 
KG
Post: Apr 19th 2007 at 5:12 PM

Did I understand you correctly: The CVS version allows you to select a native MIDI device for output?

Did I misunderstand your comment above about Java Sound not supporting native synthesisers, or are you actually using JNI to access them?


Back to Top
 
Julian
Post: Apr 19th 2007 at 5:22 PM

>Did I understand you correctly: The CVS version allows you
>to select a native MIDI device for output?
yes its right.

i don't have installed windows from some years ago..
so i didn't know Win version of JSA can see OS devices.
so i made some changes (available on CVS version).

now tuxguitar look for services. (MidiPortReader) to get mididevices..
there is one MidiPortReader implementation for Java Sound Api.. what is multiplatform.
and under linux "tuxguitar-alsa" is not a plugin anymore.. now is another implementation of MidiPortReader, what can see native Alsa ports.

this change is for make compat with GCJ (an open source Java 1.4) for next version.. without java sound api.
then tuxguitar will not depends on Sun java.


Back to Top
 
Julian
Post: Apr 19th 2007 at 5:37 PM

i forgot this:

>or are you actually using JNI to access them
tuxguitar-alsa use JNI code. so its true under linux.

with Java Sound Api, you will see the ports listed by that api..
*under linux "Java Sound synthesizer" + (if have tuxguitar-alsa service installed) Alsa ports

*under windows "Java Sound synthesizer" + native list (i test is under a virtualmachine.. but don't remember the name of native devices)


Back to Top
 
KG
Post: Apr 19th 2007 at 8:08 PM

Thanks. I've been trying the CVS version, and had a few problems. The first:

- Only one device with a given name is listed. There are several real and virtual MIDI devices (e.g. MIDI Yoke) which use the same name for their input and output device entries.

Which brings me to:

- Devices which don't have receivers should not be shown at all (getMaxReceivers() == 0; note that -1 means infinite receivers).

I have a couple more problems that I'm still looking into.


Back to Top
 
Julian
Post: Apr 19th 2007 at 8:14 PM

Midi devices are listed by Java Sound Api..
excluding (Java Sequencer instance, wicth is used as other service)

i test it on windows and it show me 2 native devices..
you you want list Virtual linux devices.. you should load vir_midi module.. but it don't woks on mi PC.. so for that is the tuxguitar-alsa module.


Back to Top
 
KG
Post: Apr 20th 2007 at 6:26 AM

I know, but you're also listing devices which don't have any receivers. And since devices can have the same name (in particular, many MIDI interfaces have the same name for their input and output devices), this often means that only the device with transmitters is shown.


Back to Top
 
KG
Post: Apr 20th 2007 at 6:31 AM

Here's the suggestion I meant. I hope it doesn't get broken by the forum software:

### Eclipse Workspace Patch 1.0
#P tuxguitar
Index: src/org/herac/tuxguitar/player/impl/jsa/midiport/MidiPortReaderImpl.java
===================================================================
RCS file: /cvsroot/tuxguitar/TuxGuitar/src/org/herac/tuxguitar/player/impl/jsa/midiport/MidiPortReaderImpl.java,v
retrieving revision 1.1
diff -u -r1.1 MidiPortReaderImpl.java
--- src/org/herac/tuxguitar/player/impl/jsa/midiport/MidiPortReaderImpl.java 25 Mar 2007 17:37:18 -0000 1.1
+++ src/org/herac/tuxguitar/player/impl/jsa/midiport/MidiPortReaderImpl.java 20 Apr 2007 09:29:06 -0000
@@ -36,7 +36,7 @@
if(device instanceof Synthesizer){
ports.add(new MidiPortSynthesizer((Synthesizer)device));
}
- else{
+ else if(device.getMaxReceivers() != 0){
ports.add(new MidiPortIn(device));
}
}


Back to Top
 
Julian
Post: Apr 20th 2007 at 9:28 AM

So, getMaxReceivers() == 0.. tell me there is no receiver available.
thanks for your help


Back to Top
 
Anonymous
Post: Feb 22nd 2012 at 3:23 AM

LF-The coast clothing is well-known brands, and also the world's most famous genuine ugg boots brand. Sold in the UK market is the United States, coast dresses uk, and are made in China. All sheep wool of fine workmanship, even in summer wear coast dresses will not feel hot. Sand and chestnut color is the most popular color, mid-counter sale of stock. There is also a concept; "Ugg boots uk" Australia produced it? coast dress most of the models are made ??in China, a small number of Coast Halter Dresses manufactured in New Zealand. But one thing to note: the United States ugg boots Useful.


Back to Top
 
women ugg boots
Post: Feb 23rd 2012 at 2:15 AM

ZY-Pick from discount barbour jacket quilted they are a nice of footwear, This ugg boots works! winter boots can be encountered in short and high styles. UGG Women Boots Ultimate Tall Braid and barbour quilted jacket can be encountered, barbour jackets to tan and earth colour outlet while UGG Men Boots can be barbour jacket in the bigger neutral colors.


Back to Top
 
sdf
Post: Apr 2nd 2012 at 3:52 AM

Do you know that there are many Louis Vuitton Outlet Stores Online,which offer the very cheap fashion items ,like the Louis Vuitton Handbags,Louis Vuitton scarf,Louis Vuitton shoes and so on.But they are not the original items from LVM.


Back to Top