hindersaliva
asked on
Sending MIDI notes - polyphonic (Chords)
This is a follow up to my earlier question (closed) here
http://www.experts-exchang e.com/Prog ramming/La nguages/Vi sual_Basic /Q_2856282 6.html
I got it to play single notes, thanks to Qlemo.
The notes play one-after-the-other. ie. monophonically. I'd like to play several notes at the same time (polyphonic). So I did this to test (lines 10 and 11)
And yes, it plays a chord. But if I fire off individual notes by calling that sub on each note the next note doesn't start until the previous one has ended.
It's the same if I comment out the Note Off event
midiOutShortMsg hMidiOut, RGB(128, lanote, 127)
So what I'm after is, to be able to fire off a Note via a Sub as above but for the Notes playing to continue until the Note Off event.
Does anyone know how please?
http://www.experts-exchang
I got it to play single notes, thanks to Qlemo.
The notes play one-after-the-other. ie. monophonically. I'd like to play several notes at the same time (polyphonic). So I did this to test (lines 10 and 11)
Sub PlayMIDI(voiceNum, noteNum, Duration)
Dim Note As Long
Dim i As Integer
On Error Resume Next
midiOutShortMsg hMidiOut, RGB(192, voiceNum - 1, 127)
lanote = 0 + CLng(noteNum)
midiOutShortMsg hMidiOut, RGB(144, lanote, 127)
midiOutShortMsg hMidiOut, RGB(144, lanote + 3, 127)
midiOutShortMsg hMidiOut, RGB(144, lanote + 5, 127)
Sleep (Duration)
midiOutShortMsg hMidiOut, RGB(128, lanote, 127)
End Sub
And yes, it plays a chord. But if I fire off individual notes by calling that sub on each note the next note doesn't start until the previous one has ended.
It's the same if I comment out the Note Off event
midiOutShortMsg hMidiOut, RGB(128, lanote, 127)
So what I'm after is, to be able to fire off a Note via a Sub as above but for the Notes playing to continue until the Note Off event.
Does anyone know how please?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
As I said :D
ASKER
Yes. Thanks Qlemo.
ASKER
I have a counter that counts each tick. That's measure > beat > tick. See?
Open in new window
My MIDI data looks like this
SongPosition Msg Voice Note
1.1.1 144 1 60
3.2.1 144 1 64
8.4.38 128 1 64
8.1.384 128 1 60
10.1.1 144 1 70
10.1.1 144 1 74
10.1.1 144 1 77
14.1.380 128 1 70
14.1.380 128 1 74
14.1.380 128 1 77