![]() |
Warum ist diese Soundkomponente stumm?
Liste der Anhänge anzeigen (Anzahl: 1)
Ich habe den Quelltext der angehängten Komponente einem Buch entnommen
Dort funktioniert er auch, doch bei mir ist dieKomponente stumm und gibt keinen Ton von sich. Bei der angehängten Komponente handelt essich um eine Klaviertaste (TPianokey), die per midiOut einen Ton ausgibt. Warum funktioniert die Komponente bei mir nicht? |
Re: Warum ist diese Soundkomponente stumm?
Gibt es keine Beschreibung hierzu?
|
Re: Warum ist diese Soundkomponente stumm?
|
Re: Warum ist diese Soundkomponente stumm?
hab ich mir angeguckt
ich stelle dieses thema auch rein, weil ich nicht weiß warum es nicht funktioniert dann brauch ich auch keine einweisung daher hilft mir das jetzt leider nicht weiter |
Re: Warum ist diese Soundkomponente stumm?
Es kommt kein Ton weil er nicht hötbar ist.
Delphi-Quellcode:
Auf diese Weise lässt es sich besser lesen. ;)
const
NOTE_ON = $90; NOTE_OFF = $80; var MidiNote: Cardinal; function MakeMidiNote(Octave, Note, Velocity: Byte): Cardinal; { Cardinal = DWORD } begin // 0..127 Octave // Note 0..11 -> C, C#, D, D#, E, F, F#, G, G#, A, A#, H // Velocity 0..127 -> Lautstärke der Note Result := (((Octave + 2) * 12 or Note mod 12) shl 8) or (Velocity shl 16); end; procedure TPianokey.MouseDown(Button:TMouseButton; Shift: TShiftstate; X, Y: Integer); begin inherited MouseDown(Button,Shift,X,Y); if (Button=mbLeft) and (midiOut<>0) then begin // midiOutShortMsg(midiOut, $FF0090+(256*FNote)); MidiNote := MakeMidiNote(Octave, FNote, 100); midiOutShortMsg(midiOut, MidiNote or NOTE_ON); end; end; procedure TPianokey.MouseUp(Button:TMouseButton; Shift: TShiftstate; X, Y: Integer); begin inherited MouseUp(Button,Shift,X,Y); if (Button=mbLeft) and (midiOut<>0) then begin // midiOutShortMsg(midiOut, $80+(256*FNote)); midiOutShortMsg(midiOut, MidiNote or NOTE_OFF); end; end; |
Re: Warum ist diese Soundkomponente stumm?
hab verstanden --> keine Lautstärke
aber klappt immer noch nicht |
Re: Warum ist diese Soundkomponente stumm?
Hast du das so in der Komponente ersetzt ?
|
Re: Warum ist diese Soundkomponente stumm?
ja habe ich
|
Re: Warum ist diese Soundkomponente stumm?
MIDI wird generell aber abgespielt?
|
Re: Warum ist diese Soundkomponente stumm?
wie meinst du das
ja, das dings im link hat bei mir funktioniert |
Alle Zeitangaben in WEZ +1. Es ist jetzt 19:31 Uhr. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz