Map music
Dec 26 2012, 12:23 am
By: stickynote
Pages: 1 2 3 >
 

Dec 26 2012, 12:23 am stickynote Post #1



I have music that plays when a player enters a particular area. However, I want the music to stop when the player leaves. Does anybody know of a way to make that happen, or do I just have to use a shorter music loop?



None.

Dec 26 2012, 12:27 am Vrael Post #2



You have to use a shorter music loop, unfortunately.

There's no way to 'stop' a WAV once its started playing. You can try breaking your wav into short chunks and then using a timer to play them in sequence, that way when a player leaves the music will only have a portion of the total file to play still, instead of the whole sound.



None.

Dec 26 2012, 12:36 am stickynote Post #3



That is unfortunate... But thanks.



None.

Dec 26 2012, 12:47 am Dem0n Post #4

ᕕ( ᐛ )ᕗ

In continuation of what Vrael said, if you want to make the music sound more fluid as you move from area to area, you can have two versions of each wav: one normal and one that fades out near the end. That way, when the player enters a new area, you can play the wav with the fade at the end so that the music fades out naturally and doesn't just abruptly stop.




Dec 26 2012, 12:52 am stickynote Post #5



I considered doing that, but I made a whole soundtrack, and the file size would be inordinately large with 2 copies of each piece.



None.

Dec 26 2012, 3:02 am rockz Post #6

ᴄʜᴇᴇsᴇ ɪᴛ!

http://www.staredit.net/files/1987/

I forget exactly what I did with this map, but essentially you can either use waits (more accurate) or pure death counters (only on fastest). Honestly death counters is the best idea.

Split your wav up into 2.02 second segments, have a death counter 1 count up/down for the length of the ENTIRE loop, and have a death counter 2 to turn on/off the song. When death counter 1 is a multiple of 24, play a specific wav file. The other option, and IMO better is to split it up into measures, so long as the measure is pretty close to a multiple of 84 ms. This works the best, as measures are natural places for songs to begin/end.

If you want to fade, it's possible to simulate it by making the main theme "louder" by playing the wav multiple times. You get significant quality loss if you abuse it, but 3 levels should be enough to get the point across.



"Parliamentary inquiry, Mr. Chairman - do we have to call the Gentleman a gentleman if he's not one?"

Dec 26 2012, 3:07 am TiKels Post #7



I had a theory awhile back about this. If you mute and then unmute volume (ie ctrl+s) wavs stop playing, so with eud actions or neuds you could force type ctrl+s ... Maybe?

Quote
I forget exactly what I did with this map, but essentially you can either use waits (more accurate) or pure death counters (only on fastest). Honestly death counters is the best idea.
If my understanding is correct, waits do not split more accurately than dc's. A wait of 10 ms should be the same as 0 ms. I forget the actual division. Your statement is false, assuming what I was taught is correct.



"If a topic that clearly interest noone needs to be closed to underline the "we don't want this here" message, is up to debate."

-NudeRaider

Dec 26 2012, 3:11 am rockz Post #8

ᴄʜᴇᴇsᴇ ɪᴛ!

waits use real time, death counters use game time.



"Parliamentary inquiry, Mr. Chairman - do we have to call the Gentleman a gentleman if he's not one?"

Dec 26 2012, 3:12 am TiKels Post #9



Quote from rockz
waits use real time, death counters use game time.
Waits use real time, but they are only checked on trigger cycles, so it's a moot point.

Like I said, I forget the actual division, but it was something like every 64 milliseconds that a trigger cycle processed on hypertrig fastest.

This means that any time between 0-64 for a wait would occur at the same distance of time (64 miliseconds). Test it yourself. Have a trigger with 0 milisecond waits between about 20 separate actions on hyper fastest. They will occur with significant difference between the first and last action.



"If a topic that clearly interest noone needs to be closed to underline the "we don't want this here" message, is up to debate."

-NudeRaider

Dec 26 2012, 3:19 am rockz Post #10

ᴄʜᴇᴇsᴇ ɪᴛ!

Sorry, I meant if you don't play on fastest waits are more accurate.

Regardless, waits are accurate to the nearest 42 ms. Whether or not the next trigger will run when the wait is over is a different story. Hypers which wait 43 ms will always fire every 3rd frame, not ever other frame.



"Parliamentary inquiry, Mr. Chairman - do we have to call the Gentleman a gentleman if he's not one?"

Dec 26 2012, 3:49 am Azrael Post #11



Quote from Dem0n
In continuation of what Vrael said, if you want to make the music sound more fluid as you move from area to area, you can have two versions of each wav: one normal and one that fades out near the end. That way, when the player enters a new area, you can play the wav with the fade at the end so that the music fades out naturally and doesn't just abruptly stop.

Yeah, that's what I did in Autocracy RPG, and it also allowed the music to fade out to silence if the player chose to turn it off. It sounds nice when paired with fade ins, which is easy to do since each track can always start at the same place :P

Although the one downside is the way it inflates the file size significantly, which unfortunately seems to be a large concern for the OP.

However, if you're going to include a whole soundtrack in your map, it's probably too large to reasonably download via bnet anyways. Personally, I'd make the wavs able to fade out, then simply upload the map to the DLDB and put the download link in one of the force names, so people can see it in the lobby and bypass bnet altogether.




Dec 26 2012, 3:59 am stickynote Post #12



I think I'll just use shorter loops and release the full soundtrack separately.



None.

Dec 26 2012, 6:52 am Oh_Man Post #13

Find Me On Discord (Brood War UMS Community & Staredit Network)

I have done some testing with this and unfortunately I could always hear the transition, it seems basically impossible to not have some sound artefact at each break.

Also for decreasing length of WAVs you can use a program, like wavpad sound editor, to change the properties of the sound file.
Select 16 bits and mono. Mono because SC only plays in mono anyway, and 16 bits... for some reason I can't remember, but same deal.

Then you choose the Hz depending on how much you are willing to butcher the quality, I usually go for 11025Hz.




Dec 26 2012, 6:59 am Azrael Post #14



Quote from Oh_Man
I have done some testing with this and unfortunately I could always hear the transition, it seems basically impossible to not have some sound artefact at each break.

You mean the break between each segment of audio? If so, it certainly is possible to transition from one clip to another without any artifacts. Those generally occur when you compress the audio, however if it's left uncompressed then there shouldn't be any issues at all.




Dec 26 2012, 5:49 pm TF- Post #15

🤙🏾

Quote from TiKels
I had a theory awhile back about this. If you mute and then unmute volume (ie ctrl+s) wavs stop playing, so with eud actions or neuds you could force type ctrl+s ... Maybe?

Sounds also stop when you hit ESC to halt all triggers, could be something there.



🤙🏾

Dec 26 2012, 7:58 pm stickynote Post #16



Quote from Oh_Man
Also for decreasing length of WAVs you can use a program, like wavpad sound editor, to change the properties of the sound file.
Select 16 bits and mono. Mono because SC only plays in mono anyway, and 16 bits... for some reason I can't remember, but same deal.

Then you choose the Hz depending on how much you are willing to butcher the quality, I usually go for 11025Hz.

I'm pretty sure SC plays in stereo.



None.

Dec 26 2012, 8:50 pm Pr0nogo Post #17



SC also downgrades all higher files to 44100Hz.




Dec 26 2012, 9:35 pm Roy Post #18

An artist's depiction of an Extended Unit Death

Quote from stickynote
I'm pretty sure SC plays in stereo.
You are correct. Take a song that obviously uses stereo (Animal by Three Day's Grace has some vocals that can only be heard in one channel in the middle of the song, for example) if you want to test this. I actually use Perfect Insanity by Disturbed in stereo for Dash 9, and you can hear the intro moving back and forth between the left and right channels.




Dec 26 2012, 11:58 pm rockz Post #19

ᴄʜᴇᴇsᴇ ɪᴛ!

Quote from Oh_Man
I have done some testing with this and unfortunately I could always hear the transition, it seems basically impossible to not have some sound artefact at each break.

Also for decreasing length of WAVs you can use a program, like wavpad sound editor, to change the properties of the sound file.
Select 16 bits and mono. Mono because SC only plays in mono anyway, and 16 bits... for some reason I can't remember, but same deal.

Then you choose the Hz depending on how much you are willing to butcher the quality, I usually go for 11025Hz.
did you notice it on my map?



"Parliamentary inquiry, Mr. Chairman - do we have to call the Gentleman a gentleman if he's not one?"

Dec 27 2012, 3:38 am O)FaRTy1billion[MM] Post #20

👻 👾 👽 💪

Quote from Roy
Quote from stickynote
I'm pretty sure SC plays in stereo.
You are correct. Take a song that obviously uses stereo (Animal by Three Day's Grace has some vocals that can only be heard in one channel in the middle of the song, for example) if you want to test this. I actually use Perfect Insanity by Disturbed in stereo for Dash 9, and you can hear the intro moving back and forth between the left and right channels.
SC does play in stereo, but I thought it played all WAVs as mono.



TinyMap2 - Latest in map compression! ( 7/09/14 - New build! )
EUD Action Enabler - Lightweight EUD/EPD support! (ChaosLauncher/MPQDraft support!)
EUDDB - topic - Help out by adding your EUDs! Or Submit reference files in the References tab!
MapSketch - New image->map generator!
EUDTrig - topic - Quickly and easily convert offsets to EUDs! (extended players supported)
SC2 Map Texture Mask Importer/Exporter - Edit texture placement in an image editor!
\:farty\: This page has been viewed [img]http://farty1billion.dyndns.org/Clicky.php?img.gif[/img] times!

Options
Pages: 1 2 3 >
  Back to forum
Please log in to reply to this topic or to report it.
Members in this topic: None.
[05:00 pm]
lil-Inferno -- benis
[10:41 am]
v9bettel -- Nice
[01:39 am]
Ultraviolet -- no u elky skeleton guy, I'll use em better
[10:50 pm]
Vrael -- Ultraviolet
Ultraviolet shouted: How about you all send me your minerals instead of washing them into the gambling void? I'm saving up for a new name color and/or glow
hey cut it out I'm getting all the minerals
[10:11 pm]
Ultraviolet -- :P
[10:11 pm]
Ultraviolet -- How about you all send me your minerals instead of washing them into the gambling void? I'm saving up for a new name color and/or glow
[2024-4-17. : 11:50 pm]
O)FaRTy1billion[MM] -- nice, now i have more than enough
[2024-4-17. : 11:49 pm]
O)FaRTy1billion[MM] -- if i don't gamble them away first
[2024-4-17. : 11:49 pm]
O)FaRTy1billion[MM] -- o, due to a donation i now have enough minerals to send you minerals
[2024-4-17. : 3:26 am]
O)FaRTy1billion[MM] -- i have to ask for minerals first tho cuz i don't have enough to send
Please log in to shout.


Members Online: Ultraviolet, Vrael, lil-Inferno, jun3hong