
-----------------------------------
INFERNO2K
Thu Jun 05, 2003 6:38 pm

Music help in a procedure
-----------------------------------
procedure playsong
    put "What song would you like to listen to?"
    put "1: Master of Puppets"
    put "2: All Along the Watchtower"
    put "3: E1M1"
    get song

    if song = "1" then
        Music.PlayFile ("mop.mid")
    elsif song = "2" then
        Music.PlayFile ("watchtower.mid")
    elsif song = "3" then
        Music.PlayFile ("e3m3.mid")
    end if

end playsong

playsong

After the user selects a song I want my program to carry on instead of playing the entire song before continuing. How might I be able to do so?

-----------------------------------
AsianSensation
Thu Jun 05, 2003 6:41 pm


-----------------------------------
use process, look it up under the turing reference/help manual, it allow you to play background music.

-----------------------------------
INFERNO2K
Thu Jun 05, 2003 6:43 pm


-----------------------------------
Im not quite sure of what the code would look like.

-----------------------------------
AsianSensation
Thu Jun 05, 2003 6:46 pm


-----------------------------------
there is a tutorial on the help section, but ok, i'll give u the code anyway.

first, declare a process


process BackGroundMusic1
loop
 Music.PlayFile ("mop.mid") 
end loop
end BackGroundMusic


when you want to play it, use fork


    if song = "1" then 
        fork BackGroundMusic1
    elsif song = "2" then 
         fork BackGroundMusic2
    elsif song = "3" then 
         fork BackGroundMusic3
    end if 


and that should allow u to play music in the background.

-----------------------------------
INFERNO2K
Thu Jun 05, 2003 6:51 pm


-----------------------------------
Awsome it worked. Cheers  :D
