Frequency Modulation Synthesis in Flash 10 and Gumbo

September 20, 2008. Posted by Andy Hulstkamp under Astro (Flash 10 beta) Gumbo (Flex 4 beta) Sound
Keywords: , ,

Frequency Modulation was discovered by John Chowning back in the 60s, while experimenting with vibrato. Basically in FM-Synthesis the frequency of one oscillator (carrier) is modulated by the signal of another oscillator (modulator). The great thing about FM-Synthesis is that it can produce a wide range of sounds with relatively little computing cost, cause we only need to generate 2 basic waveforms to get started. Ideal for environments like flash where you have to watch your fps carefully.

Frequency Modulation Test

Here’s a little test. Please turn down volume first. Needs the latest Flash-Player 10 (rc of 091508).

To do FM-Synthesis in flash we could fill the audiostream with something like this (If you need some more understanding of waveforms etc. you might want to check out this post):

Note: To get a constant timbre over different notes (pitch) we’d need to control the modulation index. This might follow in another post.

If you want to have a look at the source, here it is (flex sdk 4.0.0). UPDATE: Adobe changed the sound api. Use SampleDataEvent.SAMPLE_DATA instead of Event.SAMPLE_DATA for the listener.



Share/Save/Bookmark

Leave a Reply