View previous topic :: View next topic |
Author |
Message |
marcelo Contributor
Joined: 10 May 2008 Posts: 140
|
Posted: Sun Apr 23, 2023 2:42 am Post subject: Send MIDI data |
|
|
Hi.
I need to send midi notes to a midi port.
Is there any DLL or any way to do this from VDS?
Thanks a lot in advance... |
|
Back to top |
|
|
marcelo Contributor
Joined: 10 May 2008 Posts: 140
|
Posted: Sun Apr 23, 2023 9:14 pm Post subject: |
|
|
I'm trying and trying without luky...
Code: |
%%handle = 1
%%data = $00903C64
loadlib winmm.dll
%%Puertos = @lib(winmm.dll,midiOutGetNumDevs, INT:)
%z=@lib(winmm.dll,midiOutOpen,INT:,INT:%%handle,STR:"mfvp",INT:0,INT:0,UINT:0)
%z = @lib(winmm.dll,midiOutShortMsg,INT:,INT:%%handle,INT:%%data)
%z = @lib(winmm.dll, midiOutClose,INT:%%handle)
freelib winmm.dll
|
%%Puerttos returns "2", then 0 is the Microsoft wavetable synth and 1 my virtual port "mfvp"
But i get an error calling midiOutOpen if %%handle is different to "0"
Any idea? Help pleaaaaase. |
|
Back to top |
|
|
dmonckton Contributor
Joined: 09 Aug 2002 Posts: 117 Location: Lewes, U.K.
|
Posted: Mon Apr 24, 2023 9:45 am Post subject: |
|
|
Code: |
:outputDeviceCount
rem get the number of midi out devices
%a = @lib(winmm.dll,midiOutGetNumDevs,INT:)
exit %a
rem %1 = device number
:outputDeviceName
rem midiCapsBuffer
%b = @fill(52,,Z)
%z = @lib(winmm.dll,midiOutGetDevCapsA,INT:,%1,@addr("%b"),52)
if @unequal(%z,0)
exit error|%z
end
rem the name is stored in bytes 9 to 40 of the buffer
%x = @substr(%b,9,40)
exit %x
rem %1 = device number
:openOutputDevice
rem output device handle
%a = @fill(4,,Z)
loadlib winmm.dll
%z = @lib(winmm.dll,midiOutOpen,INT:,@addr("%a"),INT:%1,0,0,0)
if @unequal(%z,0)
exit error|%z
end
rem return the output handle
exit @val(%a)
rem %1 = output handle
:closeOutputDevice
%z = @lib(winmm.dll,midiOutClose,INT:,INT:%1)
exit %z
|
|
|
Back to top |
|
|
marcelo Contributor
Joined: 10 May 2008 Posts: 140
|
Posted: Mon Apr 24, 2023 12:31 pm Post subject: |
|
|
Yes, YES, YEEEEES!!!!!
This is exactly what i need!!
Thanks a lot!!!
You Rock!! |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You can attach files in this forum You can download files in this forum
|
|