Staredit Network > Forums > SC1 UMS Mapmaking Assistance > Topic: [SOLVED] Music Loop
[SOLVED] Music Loop
This topic is locked. You can no longer write replies here.
Jul 1 2012, 7:19 pm
By: Cadia-  

Jul 1 2012, 7:19 pm Cadia- Post #1



how do i make a sound file loop with out making it overlap eachother, i have a theme song and i want it to play again right after it finishes.


thanks for the help



None.

Jul 1 2012, 7:31 pm lil-Inferno Post #2

Just here for the pie

Multiply the length in seconds by 12, and use a deathcounter of that value to time it. When that timer is up play it again.




Jul 1 2012, 9:39 pm staxx Post #3



Quote from lil-Inferno
Multiply the length in seconds by 12, and use a deathcounter of that value to time it. When that timer is up play it again.
Follow Inferno's math if using hyper triggs

If not using hyper triggs then you would have to multiply by 0.75 and round off the number.



None.

Jul 1 2012, 9:52 pm Pr0nogo Post #4



Your typos amuse me.
Definitely use death counters instead of waits. Even if the game is paused or other waits are present in the map, death counters will run just fine and the music will loop.




Jul 1 2012, 10:04 pm Jack Post #5

>be faceless void >mfw I have no face

Isn't it 11.8 or 11.9? On longer clips it matters, being precise.



Red classic.

"In short, their absurdities are so extreme that it is painful even to quote them."

Jul 1 2012, 10:21 pm NudeRaider Post #6

We can't explain the universe, just describe it; and we don't know whether our theories are true, we just know they're not wrong. >Harald Lesch

11.9 or more exactly 1 / 84ms




Jul 2 2012, 9:56 pm Cadia- Post #7



so if i understand correctly i have to kill units? and make a counter for the deaths? or am i understanding this totaly wrong



None.

Jul 2 2012, 10:06 pm lil-Inferno Post #8

Just here for the pie

Quote from Cadia-
so if i understand correctly i have to kill units? and make a counter for the deaths? or am i understanding this totaly wrong
No, use the set deaths action to add 1 to the deaths of a certain unit. I would recommend using some of the unused units (like literally the unit "Unused"). When the deaths of that unit is at least (length of song in seconds * 12) then play the song and set the deaths of your unit to 0. Alternatively subtract 1 death of a certain unit and initially set it at (length of song in seconds * 12), and then when the death reaches 0 you can play the song and then set the death to what it originally was.




Jul 2 2012, 10:13 pm NudeRaider Post #9

We can't explain the universe, just describe it; and we don't know whether our theories are true, we just know they're not wrong. >Harald Lesch

When using Death Counters there are no actual units dying. You're using set deaths actions and suffered deaths conditions for unused units to modify the counter at your will. Like a variable in a programming language.
Combine that with Hyper Triggers which makes your triggers run every 84ms you can measure time fairly accurately:

Every trigger loop (=84ms) you add 1 to a death counter and when it reaches 10 you know 840ms have passed. Now say you have a 3 minute (180s) song you have to count to 180s / 0.084s = 2143 and then play it again and reset your death counter to 0:
Trigger
Players
  • Force 1
  • Conditions
  • Current Player has suffered at least 2143 deaths of Cantina
  • Actions
  • Set deaths of Current Player to 0 for Cantina
  • Play wav
  • Preserve Trigger





  • Jul 2 2012, 11:46 pm staxx Post #10



    Like this...

    Music.scm is with hyper triggs

    Music1.scm is without.

    Attachments:
    Music.scm
    Hits: 1 Size: 533.36kb
    Music1.scm
    Hits: 4 Size: 533.21kb



    None.

    Options
      Back to forum
    Please log in to reply to this topic or to report it.
    Members in this topic: None.
    [11:17 am]
    Zycorax -- :wob:
    [2024-4-27. : 9:38 pm]
    NudeRaider -- Ultraviolet
    Ultraviolet shouted: NudeRaider sing it brother
    trust me, you don't wanna hear that. I defer that to the pros.
    [2024-4-27. : 7:56 pm]
    Ultraviolet -- NudeRaider
    NudeRaider shouted: "War nie wirklich weg" 🎵
    sing it brother
    [2024-4-27. : 6:24 pm]
    NudeRaider -- "War nie wirklich weg" 🎵
    [2024-4-27. : 3:33 pm]
    O)FaRTy1billion[MM] -- o sen is back
    [2024-4-27. : 1:53 am]
    Ultraviolet -- :lol:
    [2024-4-26. : 6:51 pm]
    Vrael -- It is, and I could definitely use a company with a commitment to flexibility, quality, and customer satisfaction to provide effective solutions to dampness and humidity in my urban environment.
    [2024-4-26. : 6:50 pm]
    NudeRaider -- Vrael
    Vrael shouted: Idk, I was looking more for a dehumidifer company which maybe stands out as a beacon of relief amidst damp and unpredictable climates of bustling metropolises. Not sure Amazon qualifies
    sounds like moisture control is often a pressing concern in your city
    [2024-4-26. : 6:50 pm]
    Vrael -- Maybe here on the StarEdit Network I could look through the Forums for some Introductions to people who care about the Topics of Dehumidifiers and Carpet Cleaning?
    [2024-4-26. : 6:49 pm]
    Vrael -- Perhaps even here I on the StarEdit Network I could look for some Introductions.
    Please log in to shout.


    Members Online: Zycorax