Featured

PixFM – Interactive music with Flash

After PixServer, here’s the second project I started few weeks ago during my free time.
As a musician, I was interested to find a way to implement some interactive music behavior in Flash.

So I followed these steps to reach my goal:
- Dynamic sound generation: Audio tracks (volume and pan) with insertion of basic dsps.
- Implement time based sound generation: Midi tracks (tempo and steps with mp3 samples assignedon each).
- Create some randomness based on received events: Midi tracks content can be controlled by any event source.

As you can imagine, the possibilities are endless to use this approach in real cases. You could easily imagine to plug a dynamical sound loop with user interactions on a website, generate interactive music loop from game actions to rythm a gameplay, or synchronize any soundscape with screen transitions…

More features and demos to come !

Here’s a basic code example made with a draft implementation of this concept.

var tempo : Number = 120.0;
 
// Create midi patterns defining tempo and steps (quarter notes count) for each
var loopPattern : Pattern = new Pattern( tempo, 32 );
loopPattern.addStep( 0 );
 
var kickPattern : Pattern = new Pattern( tempo/2, 16 );
kickPattern.addSteps( 0, 3, 6, 8, 11, 15 );
 
var snarePattern : Pattern = new Pattern( tempo/2, 16 );
snarePattern.addSteps( 2, 4, 12, 14 );
 
var hhPattern : Pattern = new Pattern( tempo, 16 );
hhPattern.addSteps( 0, 2, 4, 6, 8, 10, 12, 13, 14 );
 
var randomPattern : Pattern = new Pattern( tempo );
randomPattern.addSteps( 1, 3, 5, 7, 9, 11, 13, 15 );
 
// build core audio station and add audio tracks defining volume and pan
_audioStation = new AudioStation( );
_audioStation.addAudioTrack( new Track(new SoundSequencer( Loop1, loopPattern ), 1, 0 ) );
_audioStation.addAudioTrack( new Track( new SoundSequencer( Kick1, kickPattern ), 0.3, 0 ) );
_audioStation.addAudioTrack( new Track( new SoundSequencer( Snare1, snarePattern ), 0.3, 0 ) );
_audioStation.addAudioTrack( new Track( new SoundSequencer( HH3, hhPattern ), 0.3, 0 ) );
 
// create some randomness trigged by keyboard events.
var soundList : Vector.<Class> = new Vector.<Class>();
soundList.push(Kick1, Snare1, HH1, HH2, HH3);
var interactiveSequencer : RandomSoundSequencer = new RandomSoundSequencer( soundList, randomPattern );
textfield.addEventListener( KeyboardEvent.KEY_UP, interactiveSequencer.eventTrigger );
_audioStation.addAudioTrack( new Track( interactiveSequencer, 0.3 ) );

Now, here is a quick demo of the concept.
Drums fills and bells notes arpeggios are trigged by keyboard events.
First, get the focus in the flash animation by clicking with your mouse. The music starts!
Now, you can hit some keys on your keyboard to interact with the music loop in realtime.

Final note: Special thanks to Andre Michelle and his Audio Sandbox for giving to me some light to begin this project.

Share on Twitter

Discussion

One comment for “PixFM – Interactive music with Flash”

  1. Nice demo !!

    I really love the concept ! You HAD to do something like that, as a musician !

    It reminds me of a game, a « word typing » game.. you should mix this idea with sounds ! « wich word sounds the most beautiful? ^^ »

    xxx

    Posted by rosyNo Gravatar | septembre 5, 2009, 3:44

Post a comment

-->

Recent Comments

  • Viagra ordre
  • Cialis en ligne
  • Levitra en ligne
  • Propecia acheter
  • Viagra acheter
  • Acheter cialis
  • Ordre levitra
  • Ordre propecia
  • En ligne viagra
  • Vente cialis
  • Levitra bon marche
  • Propecia en ligne
  • Viagra online
  • Buy cialis
  • Order Levitra
  • Buy propecia
  • Buy viagra
  • Cheap cialis
  • Cheap Levitra
  • propecia online
  • Viagra prescription
  • Cialis online
  • Buy Levitra
  • Order propecia