Pitch Music Codes

SoftboySoftboy Member, PRO Posts: 43
edited November -1 in Working with GS (Mac)
I know its possible to change music volume by code.

But can you also change the pitch?

I know sound files can be changed in pitch but I really need to change the music-files pitch in the same way.

How do I do this?

Best Regards

SoftBoy

Comments

  • gyroscopegyroscope I am here.Member, Sous Chef, PRO Posts: 6,598
    Hi Softboy, sorry to say you can only change pitch in a Play Sound Behavior, not Play Music.

    you can change the pitch of a sound using a real attribute, called PitchChange for instance. You'd put this into Pitch in the Play Sound Behaviour, and so by changing the number in the variable, you can have different pitches for different times it plays. Hope I've explained myself properly there.

    When you drag in a music file into GS and the dialog says "Music Best for audio files longer than 30 seconds" you can still import music as sound. you'll have to watch that you're not using many timers, or other system hogging stuff though if you do that. But give it a try, then you'll be able to adjust the pitch of a music track.

    Hope that's helped.

    ""You are in a maze of twisty passages, all alike." - Zork        temp domain http://spidergriffin.wix.com/alphaghostapps

  • SoftboySoftboy Member, PRO Posts: 43
    Thanks Gyroscope

    I have made a vinyl LP player that plays sound files. When you draw the mouse into the vinyl player the record and sound slows down and it sounds real.

    The only problem is that I cant seem to fix a player that can switch between the songs. I have made a NEXT and a PREVIOUS button and I can make it switch songs to certain degree. I have 3 songs that plays when an integer is 0, 1 and 2. If I switch songs in this order 0,1,2,1,0 they all play but when I go from 0 to 1 the second time the sound file stops to play. Then when I go from 1 to 2 again then sound file at integer value 2 plays fine again. Then it works fine until I am back at 0 where the sound file at integer value 1 wont play when the value is changed. Its doesn't make any sense...

    Here is my programming in Gamesalad:

    NEXT BUTTON:

    RULE:

    // game.record < 2
    Actor receives events when touch is pressed.

    CHANGE ATTIBUTE: game.record TO: game.record + 1 //

    PREVIOUS BUTTON:

    // game.record > 0
    Actor receives events when touch is pressed.

    CHANGE ATTIBUTE: game.record TO: game.record - 1 //

    PLAY SOUND RULE:

    When game.record = 0

    Play SOUND 1 - Loop X

    When game.record = 1

    Play SOUND 2 - Loop X

    When game.record = 2

    Play SOUND 3 - Loop X

    Anybody who can help me?

    Best Regards

    SoftBoy
  • gyroscopegyroscope I am here.Member, Sous Chef, PRO Posts: 6,598
    Hi again, maybe try unchecking Run to completion in all Play Sound behaviors.

    PS I've noticed you've created a new post for this; I'll delete it. Rather than make another thread, it's best to bump the same one (just make a new comment, saying "bump" or "Anyone help please?")

    :-)

    ""You are in a maze of twisty passages, all alike." - Zork        temp domain http://spidergriffin.wix.com/alphaghostapps

Sign In or Register to comment.