Yes, the audio speed manipulation that JP loves is finally back!
Well, it was there for a long time but we always forgot about it. I had implemented it in the PureData since the first time I had it integrated into Unity. I did mention it to the team that they could connect the player speed to the audio speed however they were busy with other mechanics. Then, when I changed the PureData to enable it play any song given by Unity, it was broken. Now, I had the audio looping done and in the same time, I got the audio speed and audio pause done! The game was much more fun with the audio speed. It gave you a reason to keep your position as close as to the needle. We love it, too, though when the audio was slowed down when you fell behind the needle.
Btw, if you are interested this is how our PureData patch currently looks like:
Some people who ever saw it when I worked on it said it looked cool. Brianne said it looked pretty and bJason said it looked snappy. Well, hearing people said on how it looked like, somehow I felt happy.
Pure Data indeed hard to work with as it cannot save a value in variable and everything supposed to be real time. But it is always fun to arrange it in such a neat and readable patch.
The left part of the patch is our core audio mechanics. The right part is the helper for the audio looping which I am going to describe in another post. So, how did the audio pitch is done?
First, with [soundfiler], I kept the original song in an audio array. Then, instead of telling [vline~] to play the song from the start to end within certain time, I sent the data to [vline~] every millisecond. I used [metro] to do the counter every millisecond. Therefore, there are a fairly complicated part where I did the counter from the start of the sample to the end of the sample every millisecond. However, using this mechanics, I can change the speed of the playback almost real time - almost. There maybe less that 2 milliseconds delay when PD receive the speed change until it take effect. Using this mechanics (the [metro]), I can even restart and pause the song - which is probably we want to use in our game. That's basically what I did to make the audio pitch.
Btw, if you are interested this is how our PureData patch currently looks like:
![]() |
Pure Data patch |
Pure Data indeed hard to work with as it cannot save a value in variable and everything supposed to be real time. But it is always fun to arrange it in such a neat and readable patch.
The left part of the patch is our core audio mechanics. The right part is the helper for the audio looping which I am going to describe in another post. So, how did the audio pitch is done?
First, with [soundfiler], I kept the original song in an audio array. Then, instead of telling [vline~] to play the song from the start to end within certain time, I sent the data to [vline~] every millisecond. I used [metro] to do the counter every millisecond. Therefore, there are a fairly complicated part where I did the counter from the start of the sample to the end of the sample every millisecond. However, using this mechanics, I can change the speed of the playback almost real time - almost. There maybe less that 2 milliseconds delay when PD receive the speed change until it take effect. Using this mechanics (the [metro]), I can even restart and pause the song - which is probably we want to use in our game. That's basically what I did to make the audio pitch.
No comments:
Post a Comment