Java-Gaming.org Hi !
Featured games (83)
games approved by the League of Dukes
Games in Showcase (516)
Games in Android Showcase (123)
games submitted by our members
Games in WIP (577)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  Using h/w synth via MIDI?  (Read 2219 times)
0 Members and 1 Guest are viewing this topic.
Offline 20thCenturyBoy

Senior Duke


Medals: 3


So much to learn, so little time.


« Posted 2005-05-22 10:43:26 »

Can JavaSound use the h/w MIDI synth on a soundcard?
I can use the Java Software Synthesizer no problem, because it's the default, but any attempt to redirect sequences to another synth fail miserably.

I can list all synths via a call to MidiSystem.getMidiDeviceInfo() but for the life of me I can't work out how to use the results to redirect MIDI sound to the h/w synth instead of the Java software synth. I don't even know if it's possible. There is no setSynth() method :-/

On a side note, does anyone even bother with MIDI synths these days (outside of professional musicians)?

"I have never done unit testing and I don’t find it a very useful concept" - Jonathan Blow
Offline c_lilian

Senior Duke


Projects: 1


Java games will probably rock someday...


« Reply #1 - Posted 2005-05-22 11:36:22 »

Depending on java version, midi results are different...

I used midi for Zoltar's return last year, because it requires much less space than any other format (15K is a big file). but you have to keep in mind the java sound bank is far for professional quality...

To have access to your soundcard, you can have a look at WireProvider (from memory) and hook the sequencer to its midi out ports (java 1.4 doesn't send midi event to the soundcard).

Don't know about java 5 issues (haven't tried it for a year).

have a look here : it's full of intersting informations : http://www.jsresources.org/

Lilian

Offline 20thCenturyBoy

Senior Duke


Medals: 3


So much to learn, so little time.


« Reply #2 - Posted 2005-05-22 12:38:50 »

There is no WireProvider...

I think I need to use Transmitters and Receivers but when I query my devices for these I get 0 for the number of transmitters and receivers, which means I can't connect anything up. I checked out jresources.org, they even have a sample midiplayer app that lets you select the synth on the command line, but it doesn't work (class cast exception when they try to cast a MidiDevice to a Sequencer).

I'm beginning to think it's not possible!


"I have never done unit testing and I don’t find it a very useful concept" - Jonathan Blow
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline c_lilian

Senior Duke


Projects: 1


Java games will probably rock someday...


« Reply #3 - Posted 2005-05-22 14:41:50 »

WireProvider is an external package : http://www.geocities.com/ggehnen/

And yes, it's possible (but not easy : look at the faq in jsresources.org on using sequencer and sending midi IO event ).

Lilian

Offline 20thCenturyBoy

Senior Duke


Medals: 3


So much to learn, so little time.


« Reply #4 - Posted 2005-05-22 22:26:37 »

Thanks for the link I'll check it out.

JavaSound is a great API but it's quite low level, it's taking me longer than I'd like to get my head around it.
BTW I also found http://www.jsynthlib.org/ which might have some useful stuff.

"I have never done unit testing and I don’t find it a very useful concept" - Jonathan Blow
Offline 20thCenturyBoy

Senior Duke


Medals: 3


So much to learn, so little time.


« Reply #5 - Posted 2005-05-23 13:53:12 »

Yay, got it working!

Turns out you need to get the Sequencer with a call to MidiSystem.getSequencer(false), where "false" means the Sequencer is not connected to the default Java s/w synth. Then you connect the Transmitter of the Sequencer to the Receiver of the h/w MidiDevice.

Slight problemo is that MidiSystem.getSequencer(boolean) is only available since Java 1.5.

"I have never done unit testing and I don’t find it a very useful concept" - Jonathan Blow
Offline c_lilian

Senior Duke


Projects: 1


Java games will probably rock someday...


« Reply #6 - Posted 2005-05-23 14:42:33 »

On 1.4, you can also use a third party software sequencer (the one from tritonus). It should work on any system with accurate System.currentTimeMillis. Or may be it can be hacked to use another timer - I haven't checked if the sources were available.

note : I haven't tested it, just know it exists.

note 2 : the savasound mailing list is full of interesting stuff, and not too active. you should consider registering (the author of the 1.5 java sound is there and replies fast, many other skilled people are also on the list).

Lilian  

Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

TehJavaDev (32 views)
2014-10-27 03:28:38

TehJavaDev (26 views)
2014-10-27 03:27:51

DarkCart (41 views)
2014-10-26 19:37:11

Luminem (22 views)
2014-10-26 10:17:50

Luminem (27 views)
2014-10-26 10:14:04

theagentd (33 views)
2014-10-25 15:46:29

Longarmx (61 views)
2014-10-17 03:59:02

Norakomi (58 views)
2014-10-16 15:22:06

Norakomi (47 views)
2014-10-16 15:20:20

lcass (43 views)
2014-10-15 16:18:58
Understanding relations between setOrigin, setScale and setPosition in libGdx
by mbabuskov
2014-10-09 22:35:00

Definite guide to supporting multiple device resolutions on Android (2014)
by mbabuskov
2014-10-02 22:36:02

List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!