lowering music volume

machok

Well-known member
Code:
fademusic(fade, name, loop, offset)

    With only fade as parameter, it fades the music in or out. Adding parameters, it will replace the current music.
    fade volume (0 ~ 128)
    name: pathname
    loop: toggle 1 or 0. 1 for loop music
    offset: start music offset

What you usually do to lowering music volume while in stage?
and I may need in detail how to write it
 
Solution
here is an example for musicfade:

anim rise
delay 15
offset  62 108
bbox  17 85 67 25
frame data/chars/igor/15
bbox    0 0 0 0
frame data/chars/igor/16
@cmd fademusic      0.1        "data/music/cemtry1.ogg"            1              1442779
frame data/chars/igor/17

I have personally not played around with the volume thing , in the manual it appears in the same section so i assume it works the same:
anim rise
delay 15
offset  62 108
bbox  17 85 67 25
frame data/chars/igor/15
bbox    0 0 0 0
frame data/chars/igor/16
@cmd setmusicvolume 80 80
frame data/chars/igor/17

in this example, if you knock Igor down - he will lower the music to 80 when his rise animation happens - assuming the music is playing at 128 as default...
its done in animation frames  -
this makes the death of Igor fade the current music to a another track

@cmd fademusic 0.1 "data/music/cemtry1.ogg" 1 1442779
      #        #          #      #                                  #  #

to lower the volume use this

setmusicvolume(left, right)

    left: stereo left volume (0 ~ 128)
    right: stereo left volume (0 ~ 128)

 
oldyz thank you for helping me
Can you give an example of how to write the music volume by half? (for example)
Animation frames? you mean i need to spawn this at level.txt or?

Sorry but I still new and not too familiar with lots of stuff from Openbor
 
here is an example for musicfade:

anim rise
delay 15
offset  62 108
bbox  17 85 67 25
frame data/chars/igor/15
bbox    0 0 0 0
frame data/chars/igor/16
@cmd fademusic      0.1        "data/music/cemtry1.ogg"            1              1442779
frame data/chars/igor/17

I have personally not played around with the volume thing , in the manual it appears in the same section so i assume it works the same:
anim rise
delay 15
offset  62 108
bbox  17 85 67 25
frame data/chars/igor/15
bbox    0 0 0 0
frame data/chars/igor/16
@cmd setmusicvolume 80 80
frame data/chars/igor/17

in this example, if you knock Igor down - he will lower the music to 80 when his rise animation happens - assuming the music is playing at 128 as default - if its not then the volume will rise - be careful - because with fade i experienced an "overlap" effect, meaning that if you fade in a song with the asme song the volume would rise double ( in an old version of the engine.

if this does not work in this way - then it means this works as a piece of a "script puzzle" not as a stand alone thing like fademusic
 
Solution
oldyz said:
I have personally not played around with the volume thing , in the manual it appears in the same section so i assume it works the same:
anim rise
delay 15
offset  62 108
bbox  17 85 67 25
frame data/chars/igor/15
bbox    0 0 0 0
frame data/chars/igor/16
@cmd setmusicvolume 80 80
frame data/chars/igor/17

in this example, if you knock Igor down - he will lower the music to 80 when his rise animation happens - assuming the music is playing at 128 as default - if its not then the volume will rise - be careful - because with fade i experienced an "overlap" effect, meaning that if you fade in a song with the asme song the volume would rise double ( in an old version of the engine.
It worked very well and thank you so much for make it easy for me
 
Back
Top Bottom