Win a copy of Murach's Java Programming this week in the Beginning Java forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

question about MidiSystem.getTransmitter()  RSS feed

 
meisam hasanianfar
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hello everyone.
i`m new to java. i have a problem about getting default transmitter from MidiSystem class.
this is the error that has popped up on my console.
{ javax.sound.midi.MidiUnavailableException
at javax.sound.midi.MidiSystem.getDefaultDeviceWrapper(Unknown Source)
at javax.sound.midi.MidiSystem.getTransmitter(Unknown Source)
}
or "requested device not installed"!
i want to develop a program which gets midi message from midi io ports of computer, and for that purpose  i think it is necessary to have a transmitter which transmits midi message from external device through midi io ports of PC and those ports must be somehow integrated with default transmitter. am i right?
if it is true, please help me for getting "default transmitter".
should i download it from somewhere (like oracle, unfortunately i did not find any thing)?
and if i must download the api from somewhere , how should i install it?
or should i create a transmitter class that implements   "Transmitter Interface"? if so, how should i connect objects of that class to midi io ports?
(p.s: accept my apologies for bad English)
 
Stephan van Hulst
Saloon Keeper
Posts: 7473
134
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you read the class description, it says that getTransmitter() will return a device if it implements neither Sequencer nor Synthesizer. So maybe you should try getSequencer() instead?
 
meisam hasanianfar
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thank you for replying stephan.
i want exactly a transmitter ,not a sequencer! sequencer does what it has to,(to sequence midi event to midi message or to record midi message to midi event).
a transmitter (input to the application) does transmit midi message (not midi message) to the app.
i have found a solution i think. i did not install virtual MIDI port driver(like loopb1), after installing the driver i can obtain a transmitter with MidiSystem.getTransmitter().
 
meisam hasanianfar
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"a transmitter (input to the application) does transmit midi message (not midi event) to the app"
sorry for this mistake
 
Stephan van Hulst
Saloon Keeper
Posts: 7473
134
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, sorry I was a little confused. I'm glad you managed to get it to work
 
Knute Snortum
Sheriff
Posts: 3833
91
Chrome Eclipse IDE Java Postgres Database VI Editor
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Wow.  This topic took me on a journey of discovering a lot about Java and MIDI.  If anyone is interested in what I did, click on

https://github.com/ksnortum/midi-examples
 
meisam hasanianfar
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you knute.
 
Knute Snortum
Sheriff
Posts: 3833
91
Chrome Eclipse IDE Java Postgres Database VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I updated my midi-examples to display the full range of MIDI messages.

https://github.com/ksnortum/midi-examples
 
Stephan van Hulst
Saloon Keeper
Posts: 7473
134
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Very cool. When I was looking at Midi a few weeks ago, I couldn't be bothered to check out what the opcodes for all the messages were. Have a cow!
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!