Jump to content

Recommended Posts

Posted

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
Posted

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)

Posted

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

  • 3 years later...
Posted

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.

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
×
×
  • Create New...