Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

I'd like to use javax.sound.midi.* to generate MIDI (at a specific channel, instrument and frequency), something like this:

 

public static void PlayNote(int channel, int note, int instrum)

{

try {

Synthesizer synth = MidiSystem.getSynthesizer();

synth.open();

 

final MidiChannel[] mc = synth.getChannels();

Instrument[] instr = synth.getDefaultSoundbank().getInstruments();

synth.loadInstrument(instr[instrum]);

try {

Thread.sleep(100);

} catch (InterruptedException e) {}

mc[channel].noteOn(note,200);

}

} catch (MidiUnavailableException e) {}

}

}

 

I'd like to be able to call this from a C# project.

Can I do that?

Posted
It seems unlikely that you will be able to call Java code from code based on the .Net Framework. As Java is not a low level language it requires J2EE (or one of the alternative runtime environments), as such it seems unlikely that it will be cross compatible with another language that also requires it's own runtime environment (.Net Framework). I'm no expert, thats just my 2p on the subject.
Anybody looking for a graduate programmer (Midlands, England)?

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...