Sign in to follow this  
Followers 0
quixote79

how to control midi

7 posts in this topic

#1 ·  Posted (edited)

I want to play sound using midi interface.

Is there any method of playing, reading, saving midi(file)?

Edited by quixote79

Share this post


Link to post
Share on other sites



Little example playing a MIDI file:

$MIDFile = @WindowsDir & "\media\canyon.mid"
_MCIExecute( "play " & $MIDFile )
Sleep(5700)
_MCIExecute( "stop " & $MIDFile )

Func _MCIExecute( $mciCmd )
    DllCall( "winmm.dll", "int", "mciExecute", "str", $mciCmd)
EndFunc

Share this post


Link to post
Share on other sites

Can I play specified notes and specified instruments without using a midi file?

Share this post


Link to post
Share on other sites

Can I play specified notes and specified instruments without using a midi file?

<{POST_SNAPBACK}>

maybe check "SoundPlay" in help??

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites

maybe check "SoundPlay" in help??

8)

<{POST_SNAPBACK}>

Soundplay can play typically a WAV or MP3 not Midi.

Can you give me a hint about midi function like this.

playmidi($note(s), $duration, $instrument)

Share this post


Link to post
Share on other sites

Soundplay can play typically a WAV or MP3 not Midi.

Can you give me a hint about midi function like this.

playmidi($note(s), $duration, $instrument)

<{POST_SNAPBACK}>

sorry, not a clue

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites

Little example playing a MIDI file:

$MIDFile = @WindowsDir & "\media\canyon.mid"
_MCIExecute( "play " & $MIDFile )
Sleep(5700)
_MCIExecute( "stop " & $MIDFile )

Func _MCIExecute( $mciCmd )
    DllCall( "winmm.dll", "int", "mciExecute", "str", $mciCmd)
EndFunc
Sorry for opening up such an old post but it's relevant.

So how can I determine how long the file is, 5700 needs to be changed for each midi file I would select to play. Also, I'd like to be able to have a midi file loop continuously until I request it to stop. Any way to do this? Seems like the midi.udf isn't for playing .mid files.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0