Synthesis: Randomise floats and change synth parameters

1: Use the Random Float in Range node.


2: You can get the distance between two objects if you know their World Location. Use can use the resulting float distance to scale your synth parameters.

( ( Get Player PawnGet Actor Location) - ( SelfGet Actor Location) ) → Vector Length

How to get random value from Array:

Create an Int array with those 3 values in it.
Then Get a Random Integer between 0 and the Length of that Array - 1, then use that number to get the value of the integer at that index in your array.

This way you could keep adding to that list of possible pitches, and it would still work.

Thanks again - I’m having trouble connecting the array to the random integer range, in this blueprint it’s playing random notes with a max of 2, rather than the values in the array. Thanks for your patience, getting there :slight_smile:

No problem, happy to help :slight_smile:

I updated my answer with the solution to this question.

You can use a Timer, set to some interval to trigger a new note. Or pick a Random Float to be the time that passes, then ontick add deltatime until you reach that random float value.

No problem :slight_smile:

How to use Timers

Two questions - 1. How can I randomise the three notes in my blueprint? It seems like it’d make sense to make a range of floats to switch between and feed into the first note pin but I’m having trouble doing that.
2. How can I alter different synth parameters according to the player’s distance to the sound object? Sound object is currently a blueprint actor with the synth component added that plays when the player enters a collision box. Is there some way to feed the players position into the synth preset values, so they change according to the players distance?

Thanks so much BenVlodgi, I got that working with a pitch bend and it’s exactly what I wanted :slight_smile: Regarding the note randomisation - that works but I want to randomise between specific floats - 50, 60 and 70 for example - how could I do that?

Brilliant, thanks! Last question - how can I keep playing random notes until the player leaves the trigger box? It’s easy to do with a sound cue, I really need to do get to grips with blueprints properly.

Thanks for the help! I’ll try to get this timer work, looking at the documentation too.