MIDIYOKE at Delphi 2006

I am working with an application in delphi. I need to use MIDIYOKE to send output from my application to another application. The second application is a virtual piano keyboard.

enter image description here

I installed all the packages and got the MIDI components in delphi.

I tried using the MidiOutputPort1 and MidiInput1 components. I tried to play one MIDI. The code is as follows:

procedure TForm3.Button1Click(Sender: TObject); var outputPort : TMidiOutputPort; begin outputPort := TMidiOutputPort.Create (Nil); try outputPort.PortId := -1; outputPort.Active := True; outputPort.PatchChange(0, 127, 0); // Gunshot outputPort.NoteOn (1, 20, 127); // Play note at full volume Sleep (1000); outputPort.NoteOff (0, 60, 0); finally outputPort.Free end end; 

I wanted to project the connection between my application and the piano virtual keyboard. How to use MidiOutputPort1 and MidiInput1 to connect between them.

+4
source share
2 answers

If both applications support MIDI sync, you can use MIDI sync. In this case, MIDIYOKE is the master, and Vpk is the slave. Synchronization is processed using the following commands:

 mc_MIDI_Timing_Clock = $F8; mc_MIDI_Start = $FA; mc_MIDI_Continue = $FB; mc_MIDI_Stop = $FC; 

I used it in the distant past, so my knowledge is a little rusty. From my code, I can understand that it works as follows: set the slave in slave / synchronous receive mode / regardless of what it called mode. Then send $ FA to the channel of your choice. Some (not all) slaves require listening to certain channels.

For each measure, first mark sending $ F8. Then send messages preceded by the $ FB message (both data bytes are zero). When you are ready to send $ FC.

+2
source

I think you should put the port number of one of your yoke ports in the portid property.

To find out which identifier to use, you will need to list the available ports, because the identifier can change if you add hardware, or if you change the configuration of midi yoke.

Therefore, in order to remember which ports were selected by the user, you need to save the device name and hope that the user does not rename his device :)

Let me know if this helps you to continue your work; otherwise, I will dig up old code that does what you are trying to do.

+2
source

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


All Articles