No Music Playing

Start your musical journey by discovering amazing songs and artists

Suggested For You

making a synth with flash

Help needed
sporsmaal2
sporsmaal2
Started 16 years ago
Last activity 16 years ago

every now and then i like to mess around with code to make some sounds. check my blakboard synth and FmGen http://sporsmaal2.free.fr/synth.htm recently i found out that flash player 10 has the ability to generate and manipulate sound.you can check my experiments at the link above. i did a bit of research and found out that there is not a lot of help or tutorials.  it would be nice to start a collection of links, tutorials, code and stuff  Has anyone else had a try?  got any links or code?

it all started with a sound hack of flash player 9 (now obsolete) find it here: http://www.popforge.de/ the guy who made this library's blog can be found here: http://blog.andre-michelle.com/ there are some examples here: http://lab.andre-michelle.com/ some you can download you can find some amazing stuff here: http://www.hobnox.com/audiotool

so how to make a start? generate a sine wave in 3 easy steps if you have flash cs3 or cs4

  1. start a new flash actionscript 3
  2. click on the first frame, go to the actionscript panel
  3. copy and paste the code below test movie
var mySound:Sound = new Sound();
function sineWaveGenerator(event:SampleDataEvent):void {
    for ( var c:int=0; c<8192; c++ ) {
        event.data.writeFloat(Math.sin((Number(c+event.position)/Math.PI/2))*0.25);
        event.data.writeFloat(Math.sin((Number(c+event.position)/Math.PI/2))*0.25);
    }
}
mySound.addEventListener(SampleDataEvent.SAMPLE_DATA,sineWaveGenerator);
mySound.play();

Replies

sporsmaal2
sporsmaal2
#1
Posted
Apleton
Apleton
#2

no experience in flash but i'm also interested :)

Posted
Akwalek
Akwalek
#3

Yeah cool, thx for  links

Posted
Akwalek
Akwalek
#4

iam an absolute noob on audio in flash, so iam affraid i cant help you

Posted
strekie
strekie
#6

i might wanna collaborate with someone for this one, if you ve got some designing skills and a good idea what you want, i was a flash coder for 1.5 years at an ad agency. OO AS3 programming is my thing.

Posted
strekie
strekie
#7

mm just tried out that piece of code, all it does is fill the sound buffer from the sound object with a bytearray everytime the sample_data event is triggered (when the buffer is empty)you have to fill with at least 2048 bits so you can t really synthesize unless you make a sound generator that "prepares" chuncks of 2048 bits.i tried amplitude modulation with a sine wave and it sounded like a sample and hold on the sine that controls the frequency 

Posted
sporsmaal2
sporsmaal2
#8

yes i would be up for a collab with this as i said i lost all my stuff when my laptop died, so i have none of my experiments and i lost the links to some good source code i struggle with actionscript so any help would be great have you tried this? http://lab.andre-michelle.com/fl-909 i cant get it working but i dont know what im doing using .as files and stuff i did have an example of a basic synth that i was messing with but i cant find it again i think a good thing to do is find good links and post them here

Posted
embriodub
embriodub
#9

Hey that seems wack! I once made a simple keyboard in flash with just one scale and I used samples of a specific sound created on a real synth. So all the samples where the 'same', just the notes were different. It went like this: key1 on release blablabla play sound 1.. very simple and Its fun to play in class but i never saw synthesis in flash :o 

Posted

Quick Reply

Beta