How to connect Java midi to other applications

Hi I am programming Java on Windows and am very new to working with MIDI interfaces.

I managed to get java to play midi sounds through Synthesizer objects, initially through computer speakers, but I want to send midi messages on the fly to a separate synthesis application, namely FLStudio. I think I should make the Java interface look like a hardware MIDI device, but I don't know how to do it. I also think this may have something to do with Transmitter or MidiDevice, but I'm not sure.

Does anyone know how I will start doing this. I went through all of Google about this, but I always end up in the same two docs,

http://www.jsresources.org/faq_midi.html as well as http://www.ibm.com/developerworks/library/it/it-0801art38/

Sorry if this question was asked before, but I could not find it.

Here is what I still have. Any help would be greatly appreciated.

import javax.sound.midi.*; public class Midi { public static final void main(String args[]) throws Exception { //create and open synthesizer Synthesizer syn = MidiSystem.getSynthesizer(); syn.open(); //open midi channels (we'll use channel 5) final MidiChannel[] mc = syn.getChannels(); //set instruments Instrument[] instr = syn.getDefaultSoundbank().getInstruments(); //Possible ways to send midi to FLStudio, rather than inbuilt //javax.sound.midi.Transmitter? //javax.sound.midi.MidiDevice? // change instrument, using midi codes mc[5].programChange(instr[0].getPatch().getProgram()); // Play note mc[5].noteOn(50,1000); //(noteNumber, velocity) } } 
+4
source share
1 answer

You can use a program like MidiOx to create a virtual MIDI endpoint to which you can send MIDI messages. Then in your sequencer, you simply say that it receives MIDI messages from the output of this device, and you can use it as a passthru pipe.

+3
source

Source: https://habr.com/ru/post/1383048/


All Articles