Guitar Synth for Flash
Feb27
Andre Michelle has created a guitar synth that sounds AMAZING.
It’s done w/o sampling audio, just math and FP10.
Andre Michelle has created a guitar synth that sounds AMAZING.
It’s done w/o sampling audio, just math and FP10.
Update 10/23/2008
Flash Player 10 Public Release Needed
Here is the piano. Once I can build it w/ Air I’ll make it into simple app. I would suggest downloading the swf and running it in your standalone flash player. The keyboard is huge.
I have a couple of ideas to to advance this keyboard:
If you have some ideas I’d love to hear them. Please leave me a comment.
So after 13 year of off and on drumming I have learned a thing or two about music. Not much about tuning a guitar. Thanks to a class that I got a D in, Musical Acoustics, I know every note produces a frequency and a wavelength. With that you can now you Flash to produce a frequency and that is what I did, the six notes from left to right are the notes of a regularly tuned guitar.
Since I lost my Musical Acoustics book from UNT I had to look it up to find the Frequency of All Notes
and that pick the ones I wanted starting w/ E4.
So if you don’t have a guitar tuner…here you go.
View Code:
I miss writing classes w/ 50 or so lines of code and here is one. This is a take off of Lee Brimelow’s Example of Dynamic Sound Generation. I’m using the BitmapData to create a tone.
[as]
package
{
import flash.display.*;
import flash.events.*;
import flash.media.*;
import flash.net.URLRequest;
import flash.system.Capabilities;
import flash.text.TextField;
public class DynamicSound extends Sprite
{
private var sound:Sound;
private var noise:Number = 0;
private var _loader:Loader;
private var _bm:Bitmap;
private var _verText:TextField;
public function DynamicSound():void
{
stage.align = StageAlign.TOP_LEFT;
stage.scaleMode = StageScaleMode.NO_SCALE;
_verText = new TextField();
_verText.text = Capabilities.playerType + ” (” + Capabilities.version + “)”;
_loader = new Loader();
_loader.contentLoaderInfo.addEventListener(Event.COMPLETE, onComplete, false, 0, true);
_loader.load(new URLRequest(“http://www.scarlet.nl/~ivo/photo_ASTRO3.JPEG”));
}
private function onComplete(evt:Event):void
{
_bm = Bitmap(_loader.content);
addChild(_bm);
addChild(_verText);
sound = new Sound();
sound.addEventListener(Event.SAMPLES_CALLBACK, onCallback);
sound.play();
}
private function onCallback(e:SamplesCallbackEvent):void
{
for(var i:uint=0; i<512; i++)
{
noise += _bm.bitmapData.getPixel(mouseX, mouseY)/ 44100;
var sample:Number = noise * Math.PI * 2;
sound.samplesCallbackData.writeFloat(Math.sin(sample));
sound.samplesCallbackData.writeFloat(Math.sin(sample));
}
}
}
}
[/as]
Quick and Dirty!