Ich verwende folgendes Script um einen midi sound zu erzeugen:
Delphi-Quellcode:
uses ...,mmsystem;
(...)
procedure Play(Fnote:Byte);
private
mididaten:DWord;
public
function GetmidiHandle: HmidiOut;
end;
var
Form1: TForm1;
midiout:HMIDIOUT;
(...)
function TForm1.GetMidiHandle: HMIDIOUT;
begin
Result:=midiOut;
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
if (midiout=0) and not(csDesigning in ComponentState) then
midiOutOpen(@midiout, MIDI_Mapper,0,0,Callback_Null);
end;
procedure TForm1.Play(Fnote:Byte);
begin
if midiout<>0 then
begin
mididaten:= $FF0090 or (Fnote shl 8);
midioutShortMsg(midiOut, midiDaten);
end;
end;
Das Script funktioniert super, aber ich weiß nicht wie ich FNote verändern muss um noten (wie a, b, c, d,...) zu erhalten