Click here to Skip to main content
15,903,012 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralQuestion about hooking APIs Pin
codeant3-Apr-03 2:29
codeant3-Apr-03 2:29 
GeneralRe: Question about hooking APIs Pin
User 66583-Apr-03 3:06
User 66583-Apr-03 3:06 
GeneralRe: Question about hooking APIs Pin
codeant4-Apr-03 18:10
codeant4-Apr-03 18:10 
GeneralRe: Question about hooking APIs Pin
User 66585-Apr-03 1:32
User 66585-Apr-03 1:32 
GeneralRe: Question about hooking APIs Pin
codeant5-Apr-03 18:59
codeant5-Apr-03 18:59 
GeneralA Frame/view/doc question! Very Hard Pin
zhangyifei3-Apr-03 2:26
zhangyifei3-Apr-03 2:26 
GeneralNewbie help, API Pin
bob_0003-Apr-03 1:26
bob_0003-Apr-03 1:26 
GeneralRe: Newbie help, API Pin
Mike Upton3-Apr-03 4:53
Mike Upton3-Apr-03 4:53 
bob_000 wrote:
void CAD_mouthDlg::StopNote()
{
    if(m_Key_Press == FALSE)
    {
       MidiOutMessage (hMidiOut, 0x00, 0x90, m_Note2,0) ;
    }
    else
    {
    }
}


Well, one of your problems is that the MIDI note off message code is 0x80 (to 0x8F for different channels), not 0x90 (0x90 - 0x9F are note-on messages for channels 0-15)). As you probably know, MIDI uses a Note On message to start a note and a Note Off message to stop it.

[Edit] Oops - I just checked a MIDI spec, and a Note On message with velocity zero, which is what you're doing, should also work as a Note Off. Sorry![/Edit]

However, you're still going to run into problems. Calling StopNote() immediately after PlayNote() (assuming m_Key_Press == FALSE) will result in a note too short for you to hear. But if m_Key_Press is TRUE (so the stop message doesn't get sent), the next time your timer triggers another note on will be sent (maybe with the same pitch) without you having sent a stop message. You might get the same note played again, which will sound wierd, or the previous note might stop - it kinda depends on the synth you're sending the MIDI messages to. Anyway, wind instruments are normally monophonic so you'd want to stop the previous note before starting the new one. But that's more an app-logic problem, and that all depends on what you're trying to do!



"We are the knights who say Ni" (The Knights Who Say Ni)
GeneralImage attributes (eps and cgm) Pin
vandaley3-Apr-03 0:44
vandaley3-Apr-03 0:44 
QuestionHow can I find a win32 version of lex? Pin
xiaochnegwx3-Apr-03 0:24
xiaochnegwx3-Apr-03 0:24 
AnswerRe: How can I find a win32 version of lex? Pin
Johnny ²3-Apr-03 0:46
Johnny ²3-Apr-03 0:46 
QuestionHow to create a directory Pin
Anonymous2-Apr-03 23:39
Anonymous2-Apr-03 23:39 
AnswerRe: How to create a directory Pin
Joan M2-Apr-03 23:56
professionalJoan M2-Apr-03 23:56 
AnswerRe: How to create a directory Pin
Philip Patrick3-Apr-03 0:14
professionalPhilip Patrick3-Apr-03 0:14 
GeneralRe: How to create a directory Pin
Mikey_E16-Jun-04 7:39
professionalMikey_E16-Jun-04 7:39 
GeneralWant to write a video/audio interaction software using VC. Pin
George22-Apr-03 23:25
George22-Apr-03 23:25 
GeneralRe: Want to write a video/audio interaction software using VC. Pin
extremalis6-Apr-03 3:12
extremalis6-Apr-03 3:12 
GeneralRe: Want to write a video/audio interaction software using VC. Pin
George27-Apr-03 22:00
George27-Apr-03 22:00 
GeneralRe: Want to write a video/audio interaction software using VC. Pin
extremalis18-Apr-03 14:54
extremalis18-Apr-03 14:54 
GeneralRe: Want to write a video/audio interaction software using VC. Pin
George218-Apr-03 18:24
George218-Apr-03 18:24 
GeneralRe: Want to write a video/audio interaction software using VC. Pin
extremalis20-Apr-03 14:55
extremalis20-Apr-03 14:55 
GeneralRe: Want to write a video/audio interaction software using VC. Pin
George220-Apr-03 17:51
George220-Apr-03 17:51 
GeneralRe: Want to write a video/audio interaction software using VC. Pin
Anonymous20-Apr-03 17:14
Anonymous20-Apr-03 17:14 
GeneralRe: Want to write a video/audio interaction software using VC. Pin
George220-Apr-03 17:50
George220-Apr-03 17:50 
QuestionGet name of process by socket ? Pin
Bash2-Apr-03 21:56
Bash2-Apr-03 21:56 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.