forum.vdsworld.com Forum Index forum.vdsworld.com
Visit VDSWORLD.com
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Send MIDI data

 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help
View previous topic :: View next topic  
Author Message
marcelo
Contributor
Contributor


Joined: 10 May 2008
Posts: 140

PostPosted: Sun Apr 23, 2023 2:42 am    Post subject: Send MIDI data Reply with quote

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
View user's profile Send private message
marcelo
Contributor
Contributor


Joined: 10 May 2008
Posts: 140

PostPosted: Sun Apr 23, 2023 9:14 pm    Post subject: Reply with quote

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
View user's profile Send private message
dmonckton
Contributor
Contributor


Joined: 09 Aug 2002
Posts: 117
Location: Lewes, U.K.

PostPosted: Mon Apr 24, 2023 9:45 am    Post subject: Reply with quote

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
View user's profile Send private message
marcelo
Contributor
Contributor


Joined: 10 May 2008
Posts: 140

PostPosted: Mon Apr 24, 2023 12:31 pm    Post subject: Reply with quote

Yes, YES, YEEEEES!!!!!
This is exactly what i need!!

Thanks a lot!!!
You Rock!!
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help All times are GMT
Page 1 of 1

 
Jump to:  
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

Twitter@vdsworld       RSS

Powered by phpBB © 2001, 2005 phpBB Group