Linking sounds playback pitch (speed) to other attributes..

Hi all. Got another poser for you..
I'm working on a game which requires the pitch of some sounds to react actively to player touch inputs.
Eg: Touching at position X = Playback at 3 times the normal pitch
Touching at position Y = Playback at a fraction of normal speed
There is an expression editor in the sound playback field so what I'm wondering is..
Can I constrain the pitch (speed) of playback to any other attribute? If so how?
Cheers guys / gals..
Lbc4ever
I'm working on a game which requires the pitch of some sounds to react actively to player touch inputs.
Eg: Touching at position X = Playback at 3 times the normal pitch
Touching at position Y = Playback at a fraction of normal speed
There is an expression editor in the sound playback field so what I'm wondering is..
Can I constrain the pitch (speed) of playback to any other attribute? If so how?
Cheers guys / gals..
Lbc4ever
Comments
You know how to use attributes ? You've already pointed out there's an expression editor for pitch ?
Guru Video Channel | Lost Oasis Games | FRYING BACON STUDIOS
1. Created a game attribute (integer) and called it sound pitch
2. Created a rule which changes that attribute to mouse.position x whenever a certain actor is touched, then put it in a timer to update every 0.01 seconds.
3. Created a play sound rule and in the expression editor set pitch to game.sound pitch divided by 10.
It works like a charm. I'm in the process of adjusting the maths to have 0 pitch in the middle of the actor and not on the far left. Then
I will import a reversed duplicate of the sound and repeat the process, giving a "DJ scratch" effect in the game.
I appreciate your taking the time. Getting there bit by bit.
Lbc4ever.
Guru Video Channel | Lost Oasis Games | FRYING BACON STUDIOS
I will have a look at that. Will changing the attribute to "real" have any impact on performance? (It's stingy I know but I like to try to keep resource usage to a minimum).
@ FryingBacon, you're quite right about learning what it's possible to achieve but it'll be a while before I'm proud of my "extensive" Gsalad knowledge
Thanks again guys,
Lbc4ever.