Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Multimedia (https://www.delphipraxis.net/16-multimedia/)
-   -   Delphi midi sound: noten erzeugen (https://www.delphipraxis.net/37212-midi-sound-noten-erzeugen.html)

XeRo 2. Jan 2005 14:38


midi sound: noten erzeugen
 
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 :gruebel:


Alle Zeitangaben in WEZ +1. Es ist jetzt 14:41 Uhr.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz