
-----------------------------------
Crunked89
Wed Mar 10, 2004 8:16 pm

Music help
-----------------------------------
im just looking for a way to play music in a program.. thats all.. i tryed posting other places but noone wanted to help and just said beat it.. :oops:  :( 


hope you can help :roll:

-----------------------------------
jonos
Wed Mar 10, 2004 8:31 pm


-----------------------------------
well, it depends on what music. you could use
play or Music.Play which would allow you to make individual notes and compose a song.

like:

Music.Play("abcd")

check out the turing reference in help>>reference>> contents or soemthing to learn more about it.

for playing a file in turing:

Music.PlayFile("pathoffile.wav/.mp3/.midi")

if you ened help with that, also hceck the turing reference.

now you will want to fork that i think so that it will play along with your whole program, so you will need to make it a process, so:

process myMusic
     Music.PlayFile("myMusicFile.midi/.wav/.mp3")
end myMusic

fork myMusic
your other program stuff

-----------------------------------
guruguru
Wed Mar 10, 2004 8:39 pm


-----------------------------------
Quite redundant program but it shows what can be done...
You can sub in songs from files (like Jonos) for the play("Whatever").



process music
    loop
        play ("a")
        delay(10)
        play ("b")
        delay(10)
        play ("c")
        delay(10)
        play ("d")
        delay(10)
        play ("e")
        delay(10)
        play ("f")
        delay(10)
        play ("g") 
    end loop
end music

fork music
loop
    put "Music is playing!!!"
    delay(100)    
    put "This is amazing!!!"
    delay(100)       
end loop



-----------------------------------
Crunked89
Wed Mar 10, 2004 8:46 pm


-----------------------------------
im trying to play a file.. but i get a "illegal extended character string literal" message

-----------------------------------
Cervantes
Wed Mar 10, 2004 8:50 pm


-----------------------------------
I think that's because you've got your brackets backwards.

use / not \

-----------------------------------
Crunked89
Wed Mar 10, 2004 9:06 pm


-----------------------------------
oops.. well theres no errors just no sound

-----------------------------------
Cervantes
Wed Mar 10, 2004 9:17 pm


-----------------------------------
that could be because you typed the path wrong.  Check it and make sure everything is correct.  If something is wrong, it won't give you an error.  It will just skip over it.

-----------------------------------
recneps
Wed Mar 10, 2004 9:21 pm


-----------------------------------
Also check that you are using double slashes (\\) if its not in the same directory as the .t file, you need double because 1 indicates a parameter or something... :)

-----------------------------------
jonos
Wed Mar 10, 2004 9:24 pm


-----------------------------------
\ slash usually allows for special commands like:
\n means new line
\a means alert (in c++)
\" means double quote (i think, not sure)

so if you use just \ then it has nothing after it so you can't really do anything,
but if you use \\ then it has something after it. something like that, i think iread that somewhere.

-----------------------------------
Crunked89
Wed Mar 10, 2004 9:26 pm


-----------------------------------
y wont it work.. everythings correct..

 process myMusic
 Music.PlayFile("C:/My Music/Yeah.mp3")
 end myMusic 

-----------------------------------
jonos
Wed Mar 10, 2004 9:27 pm


-----------------------------------
you need to add:


fork myMusic


to your code, because as it is a process, for it to be executed, it needs to be called.

-----------------------------------
Cervantes
Wed Mar 10, 2004 9:29 pm


-----------------------------------
I was using this to test various things while this thread was up:

Music.PlayFile ("C:/My Documents/My Music/John Lennon/John Lennon - Imagine.mp3")

single / .  Works fine for me.  
jonos: /n is not a new line.  It's \n  :)

-----------------------------------
Crunked89
Wed Mar 10, 2004 9:31 pm


-----------------------------------
is there a way to just post the full code because im kind of lost.

-----------------------------------
Cervantes
Wed Mar 10, 2004 9:35 pm


-----------------------------------
jonos first post is all you need to look at.  you don't need to pay attention to what spencer (aka recneps) said, or any posts until this one.

-----------------------------------
Crunked89
Wed Mar 10, 2004 9:36 pm


-----------------------------------
where do i put the fork thingy..  :wink: lol :roll:

-----------------------------------
Cervantes
Wed Mar 10, 2004 9:42 pm


-----------------------------------
the fork goes wherever you want it to go. What you need to understand about fork is that, as soon as it is called up, it will execute the code inside the process (in this case, that code is Music.PlayFile (blahblahblah) ) while executing any code afterwards.  

So basically, put the fork where ever you want the musci to begin playing.

-----------------------------------
Crunked89
Wed Mar 10, 2004 9:51 pm


-----------------------------------
this is getting totaly  :censored:  :evil: frustrating :evil: ... no offence its just i got the fork thing down just no music.. thats all i need is the music to play.. i dont need any vars or anything do i?

sry...



ill be back in the morning.. gone to bed.. ill read them in the morning

-----------------------------------
Cervantes
Wed Mar 10, 2004 10:06 pm


-----------------------------------
you don't need any variables.  PM me with the code tommorow and verify that the path is correct, and I'll try to help.

-----------------------------------
jonos
Wed Mar 10, 2004 11:18 pm


-----------------------------------
cervatnes wrote

jonos: /n is not a new line. It's \n 


ahh, im getting too confused. thanks for the correction, ive disgraced myself again.[/quote]
