开发者

How to simulate guitar strings/chords with Flash's sound synthesizer?

开发者 https://www.devze.com 2023-02-22 12:47 出处:网络
I\'ve just developed a function to ring frequencies, but I can\'t make it sound like a guitar string; I can only change it\'s frequency. Is there some way to change other pa开发者_如何转开发rameters o

I've just developed a function to ring frequencies, but I can't make it sound like a guitar string; I can only change it's frequency. Is there some way to change other pa开发者_如何转开发rameters of a generated sound?

function sineGenerateSound(event:SampleDataEvent):void
        {

            for (var i:int=0; i<4092; i++)
            {

                var n:Number = Math.sin((i + event.position) * Math.PI / (44100 / (freq*2) )) * volume;

                event.data.writeFloat(n);
                // sound crackles and pops;
                event.data.writeFloat(n);
            }

        }


I would recommend SiON, as a good synthesis library, which includes a Guitar Synthesis module which you may find useful, as always YMMV.

0

精彩评论

暂无评论...
验证码 换一张
取 消