• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Simple Midi Problem

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
... from a Java newbie, fluent in other languages.

I am trying to create a simple program that will open a midi out port on my computer and send a note to it. My computer is running Windows and i run the following code in order to find out the available midi ports on my machine:





The code reveals the following information:





... so , all i want to do is select any of these ports and send a C to it for a given time duration.

Any help is welcome.

Best Regards
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Welcome to JavaRanch.

I think the you need to create several objects, first a Sequencer, then a Track, then a MidiEvent, and finally a MidiMessage with the appropriate data. It looks like you need to know the MIDI file format for this.

An example -which doesn't actually look all that complicated- can be found here.
 
P Katergiathis
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you for replying.
I am aware of the technique that you described (and the related example), yet it is not what i want, because it sends a note to a "synthesizer", namely the default windows synth of my on-board card.

What i need is a way to send a midi message (a midi event, actually) to a pre-defined "receiver", in order to drive (via midi) an external synth.

Take this code for example:



... taken from the book mentioned in the comment and it's related web site.
It gets a list of installed midi outputs and (supposedly) will send a midi event, yet it does not seem to work in the sense that the author does not provide adequate info on how to construct such a midi event, or the way that a specific "receiver" is selected.

Any more thoughts?

Panos
[ February 18, 2007: Message edited by: Panos Katergiathis ]
 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I don't know nothing about this, but was wondering if this can hep you:

The Java Sound API specification provides low-level support for audio operations such as audio playback and capture (recording), mixing, MIDI sequencing, and MIDI synthesis in an extensible, flexible framework.


taken from: http://java.sun.com/products/java-media/sound/
Does that sound like it's ossible to do what you want? Either way I found this FAQ:
http://www.jsresources.org/faq_midi.html
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic