HOME | DD

wonderwhy-ER — MP3 Pitcher -Update- by-nc-nd

Published: 2009-08-27 22:50:06 +0000 UTC; Views: 11820; Favourites: 123; Downloads: 490
Redirect to original
Description So this is continuation to my experiments with music. One of important new features of Flash 10 is possibility to extract raw music data + feed raw music data to sound card as stream of bytes. All that together allows to do manual sound filters that alter sound as it is passed to SoundCard. Here is one I really wanted to do

So click Load and pick some mp3 file. Then try changing Pitch slider position. To the right it starts to play faster. To the left it starts to slow down until stopping completely and then playing in reverse

For those who are curious I used linear interpolation when stretching it and average when squeezing. Tough it is little bit glitch and my technique is limited as I can only use whole steps. That's why I use only steps like 1/2 or 4 for speed... Will need to experiment/work on it more.


Also having a lot of fun listening a lot of music with 1/2 or 2 speed. Or with -1 speed Funny that pop starts to sound like metal sometimes at 1/2


Update:
Ok spent some time thinking and made number of changes to my interpolation algorithm. Now it allows any type of step. Not only powers of 2 So you can very smoothly change speed of play which sounds really cool Should be cool to use this effect in some say racing game where with higher speeds music plays faster Or with games where slowmo is used
Related content
Comments: 141

Keydan In reply to ??? [2009-09-05 22:06:59 +0000 UTC]

No. Just funny

👍: 0 ⏩: 0

Zombie-Bunneh In reply to ??? [2009-09-05 16:49:32 +0000 UTC]

This is really fun

👍: 0 ⏩: 1

wonderwhy-ER In reply to Zombie-Bunneh [2009-09-05 17:44:01 +0000 UTC]

Thanks It is IF only it was possible to get binary data from microphone in flash Would have been a lot more fun then

👍: 0 ⏩: 1

Zombie-Bunneh In reply to wonderwhy-ER [2009-09-05 19:34:07 +0000 UTC]

If you say so I don't know much about that sort of thing, I'm afraid.

👍: 0 ⏩: 1

wonderwhy-ER In reply to Zombie-Bunneh [2009-09-05 20:32:20 +0000 UTC]

I mean that you could say something and hear it in a lower or higher frequencies

👍: 0 ⏩: 1

Zombie-Bunneh In reply to wonderwhy-ER [2009-09-05 22:06:12 +0000 UTC]

I thought that might be what you meant. That would be really cool!

👍: 0 ⏩: 0

alimjshafi In reply to ??? [2009-08-28 20:28:48 +0000 UTC]

Kind of DJ thingy... liked it...

I tried Rob Dougan Track Darkside.

👍: 0 ⏩: 1

wonderwhy-ER In reply to alimjshafi [2009-08-28 21:47:40 +0000 UTC]

Yeah kind of

👍: 0 ⏩: 0

yadu [2009-08-28 15:33:23 +0000 UTC]

I was wondering.. when u said sending it as a stream of bytes to the sound card.. we don't have access to the sound card hardware.. do we.. or did i miss something really big.. I'm wondering why because, I wanted to send some midi notes to the midi synthesizer any ideas?!

+ awesome experiments as always ^_^

👍: 0 ⏩: 1

wonderwhy-ER In reply to yadu [2009-08-28 17:32:49 +0000 UTC]

No we don't But there is this thing that you can create an empty Sound object. Register SoundDataEvent to it and send raw ByteArray that contains your function to it from where it goes to soundcard. Of course it is not direct access but.

👍: 0 ⏩: 1

yadu In reply to wonderwhy-ER [2009-08-31 07:27:57 +0000 UTC]

this sounds interesting

two things.. how did u come about this? any documentation? and any code samples pls?

👍: 0 ⏩: 1

wonderwhy-ER In reply to yadu [2009-08-31 08:29:01 +0000 UTC]

Check all that Sound generation in Flash things trough google. Or just in short check Flash documentation [link] for Sound.sampleData as it has small example on how to use it.

👍: 0 ⏩: 1

yadu In reply to wonderwhy-ER [2009-08-31 08:34:52 +0000 UTC]

thnx

👍: 0 ⏩: 0

cepums In reply to ??? [2009-08-28 07:36:39 +0000 UTC]

hahahaha.. fun fun fun

👍: 0 ⏩: 1

wonderwhy-ER In reply to cepums [2009-08-28 08:01:42 +0000 UTC]

Yeah Tough I will try to upgrade it... Kind of unstable at lower speed (you can hear some scratches or something) and I want less precise steps like 0.1231 and stuff

👍: 0 ⏩: 0

a-freakin-rpg-gamer In reply to ??? [2009-08-28 04:19:29 +0000 UTC]

"A Shot in the Dark" by A Day to Remember sounds freaking awesome on pitch speed 2. I love it

👍: 0 ⏩: 1

wonderwhy-ER In reply to a-freakin-rpg-gamer [2009-08-28 07:27:40 +0000 UTC]

Yeah I kind of like how some sound at 2 too Actually this thing is fun for games probably. I an little bit speed up or slow down music making it more or less intense Need to fix some problems first tough

👍: 0 ⏩: 1

a-freakin-rpg-gamer In reply to wonderwhy-ER [2009-08-29 03:16:51 +0000 UTC]

do you think there'd be a way to isolate each sounds pitch? Like leaving the instruments alone, but altering the pitch of the vocals, or vice versa? Or each individual instrument? That'd be sick.

👍: 0 ⏩: 1

wonderwhy-ER In reply to a-freakin-rpg-gamer [2009-08-29 07:57:44 +0000 UTC]

No it is impossible to do it perfectly in all of the cases. Thing is that after you recorded music as one signal it becomes a sum of frequencies... You can't divide them. Only way is learning how instruments sounds and how vocals sound and using recognition algorithms. But problem is that even musicians/humans rate of mistakes is something like 30% right? For most modern algorithms mistakes are even bigger. And I doubt that it ever will be better then 90% because there are cases when voice sounds like violin and violin sounds like voice and they are together there... It is just impossible...

👍: 0 ⏩: 1

a-freakin-rpg-gamer In reply to wonderwhy-ER [2009-08-29 21:30:30 +0000 UTC]

ah, that's alright. Still fun to listen to songs in reverse

👍: 0 ⏩: 1

wonderwhy-ER In reply to a-freakin-rpg-gamer [2009-08-29 22:22:37 +0000 UTC]

👍: 0 ⏩: 0

flashygoodness In reply to ??? [2009-08-28 00:09:46 +0000 UTC]

That's really really neat! I've got to learn to do this stuff too.

👍: 0 ⏩: 1

wonderwhy-ER In reply to flashygoodness [2009-08-28 07:26:49 +0000 UTC]

Thanks

👍: 0 ⏩: 0

ElectricRain In reply to ??? [2009-08-27 23:53:08 +0000 UTC]

You should make some kind of virtual turntable thing where you can "scratch" mp3s! Just tie the pitch value to the rotation value of a movie clip.

👍: 0 ⏩: 1

wonderwhy-ER In reply to ElectricRain [2009-08-28 07:26:41 +0000 UTC]

Nah it will not be as good as real anyways...

👍: 0 ⏩: 0

YoungLink19 In reply to ??? [2009-08-27 23:33:05 +0000 UTC]

QuickTime can play music at different pitch and speed - is it possible for FP10 to handle these two parameters separately?

If Flash CS4 does not have all those bugs and problems, I'll really like it. The current Flash CS4 and FP10 are rather problematic though.

A standalone Flash Player window, when maximized, will draw only up to an area of 2000*2000 pixels unless the user or the SWF asks it to redraw the region. This makes large resolution monitors, like my 2048*1152 desktop area, not showing the contents properly.

Like this.

👍: 0 ⏩: 1

wonderwhy-ER In reply to YoungLink19 [2009-08-28 07:25:59 +0000 UTC]

Thing is that in reality pitch and speed is the same thing for sounds. What you probably mean by speed then is that it rewinds it by skipping parts of mp3 no?

👍: 0 ⏩: 1

YoungLink19 In reply to wonderwhy-ER [2009-08-28 12:16:59 +0000 UTC]

I'm not familiar with audio stuff, but I'll try to explain.

If you have QuickTime, you should have seen the A/V Controls.

I'm talking about this: [link]

Pitch shifts the frequency of the audio, and speed is somewhat like what you said, makes the audio look longer or shorter by expanding or collapsing the timeline of the audio data.

And now my question: Can FP10 treats these separately?

👍: 0 ⏩: 2

psykopath In reply to YoungLink19 [2009-08-30 09:20:20 +0000 UTC]

"Can FP10 treats these separately?"

It's all up to the programmer modifying the bytes.

👍: 0 ⏩: 0

wonderwhy-ER In reply to YoungLink19 [2009-08-28 18:20:45 +0000 UTC]

You know honestly I have no idea what they do there... I have QT and tested it. Their Pitch seems to be changing frequencies in other way... As for SpeedUp it seems more like my pitching but somehow it seems not skipping and not altering frequencies much...

👍: 0 ⏩: 1

YoungLink19 In reply to wonderwhy-ER [2009-08-28 18:55:03 +0000 UTC]

Oh.... I see. It's alright

👍: 0 ⏩: 0

hypnothalamus In reply to ??? [2009-08-27 23:17:49 +0000 UTC]

it's funny to hear a famous man singer turn into a famous female singer (there were a few of these on youtube)

👍: 0 ⏩: 2

ShnitzelKiller In reply to hypnothalamus [2009-08-28 06:04:50 +0000 UTC]

How or where do you get such MP3 files?

👍: 0 ⏩: 1

hypnothalamus In reply to ShnitzelKiller [2009-08-28 10:10:01 +0000 UTC]

you can take any mp3 song (any sound for that matter) and change the pitch

👍: 0 ⏩: 1

ShnitzelKiller In reply to hypnothalamus [2009-08-28 22:06:56 +0000 UTC]

I mean where can I get some good mp3 files for this?

👍: 0 ⏩: 2

hypnothalamus In reply to ShnitzelKiller [2009-08-28 22:29:34 +0000 UTC]

I don't know - I think there was one with Kylie Minogue turned into George Michael so if you find a song by any of them load it and change the pitch and see if they turn into the other

👍: 0 ⏩: 0

hypnothalamus In reply to ShnitzelKiller [2009-08-28 22:29:27 +0000 UTC]

I don't know - I think there was one with Kylie Minogue turned into George Michael so if you find a song by any of them load it and change the pitch and see if they turn into the other

👍: 0 ⏩: 0

wonderwhy-ER In reply to hypnothalamus [2009-08-27 23:18:41 +0000 UTC]

It's possible the other way around too. I mean female to male

👍: 0 ⏩: 1

hypnothalamus In reply to wonderwhy-ER [2009-08-27 23:29:08 +0000 UTC]

obviously... forgot to put in the "and viceversa"

👍: 0 ⏩: 1

wonderwhy-ER In reply to hypnothalamus [2009-08-28 07:22:04 +0000 UTC]

👍: 0 ⏩: 0


<= Prev |