Results 1 to 10 of 10

Thread: Starting MIDI

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Nov 1999
    Posts
    184

    Arrow

    How can i use this code

    Code:
    ret = mciSendString("open " & "c:\midi\" & FileName & ".mid  type sequencer alias canyon", 0&, 0, 0)
       ret = mciSendString("play canyon", 0&, 0, 0)
    But make the midi start at 22 seconds ??
    Evan Duffield --------
    --- [email protected]
    - -
    VB6 - Learning Edition
    - -


  2. #2
    Guest

    Put the following code in a Timer and make the Inverval 22000

    Code:
    Private Sub Timer1_Timer()
    
    ret = mciSendString("play canyon", 0&, 0, 0)
    Timer1.Enabled = False
    
    End Sub

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Nov 1999
    Posts
    184
    Not end at 22 seconds.
    I want the midi to start at
    22 seconds.

    And timers suck.. Use Gettickcount
    Evan Duffield --------
    --- [email protected]
    - -
    VB6 - Learning Edition
    - -


  4. #4
    Guest
    That code will play it in 22 seconds. The mciSendString's open command will open the MIDI. That actual playing of it is done when you use the play command, thus when the 22 seconds is up, the MIDI will play.

    Yes, GetTickCount is better than Timers but QueryPerformanceCounter is better than GetTickCount.

  5. #5

    Thread Starter
    Addicted Member
    Join Date
    Nov 1999
    Posts
    184
    Yeah thanks but I need the midi to start playing
    right away, is there anyway to do that?
    Evan Duffield --------
    --- [email protected]
    - -
    VB6 - Learning Edition
    - -


  6. #6
    Guest
    Right away??? I thought you said 22 seconds? To make it play right away, the code you were using above was fine.

  7. #7

    Thread Starter
    Addicted Member
    Join Date
    Nov 1999
    Posts
    184
    lol no..

    Listen carefully.

    The midi will play for 2 minutes.

    And I would Like To play for 1 1/2 minutes .
    I want it to start AT 22 seconds (Not IN 22 seconds)

    I play the midi from the beginning, and then
    I want to be able to stop it, and later
    continue from where it left off.

    How do you do that?
    Evan Duffield --------
    --- [email protected]
    - -
    VB6 - Learning Edition
    - -


  8. #8
    Guest
    Try this. This pauses the MIDI. To play it again, just use the play command.

    Code:
    ret = mciSendString("pause canyon", 0&, 0, 0

  9. #9

    Thread Starter
    Addicted Member
    Join Date
    Nov 1999
    Posts
    184
    Thanks..

    Sounded like a good idea but this is
    what occured.

    I want the midi music to pause and then
    ANOTHER midi begin to play, and then
    after awhile, the first midi unpause.
    But a error occurs because the midi
    device is busy.

    Any other way to do it?

    Thanks..
    Evan Duffield --------
    --- [email protected]
    - -
    VB6 - Learning Edition
    - -


  10. #10
    Guest
    You can only play one MIDI at a time. I'll see if i can find a way to solve your problem. A Multimedia Control Control might do it.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width