In case Flash no longer exists; a copy of this site is included in the Flashpoint archive's "ultimate" collection.

Dead Code Preservation :: Archived AS3 works from wonderfl.net

SiONの練習part3

0.1sずつ音が高くなっていく
* けど、タイミングがおかしいよーー(><)
*
Get Adobe Flash player
by umi_kappa 29 Jun 2010
    Embed
/**
 * Copyright umi_kappa ( http://wonderfl.net/user/umi_kappa )
 * MIT License ( http://www.opensource.org/licenses/mit-license.php )
 * Downloaded from: http://wonderfl.net/c/ttPL
 */

/*
 * 0.1sずつ音が高くなっていく
 * けど、タイミングがおかしいよーー(><)
 * */

package {
	import flash.display.*;
	import flash.events.TimerEvent;
	import flash.utils.Timer;
	import org.si.sion.*;
	import org.si.sion.utils.*;
	
    public class Main extends Sprite {
		private var driver:SiONDriver;
		private var presetVoice:SiONPresetVoice;
		private var voice:SiONVoice;
		
		private var timer:Timer;
		private var note_count:int = 60;
		
        public function Main() {
			driver = new SiONDriver;
			presetVoice = new SiONPresetVoice;
			voice = new SiONVoice;
			voice = presetVoice["valsound.lead10"];
			driver.play();
			
			timer = new Timer(20);
			timer.addEventListener(TimerEvent.TIMER, onTimer);
			timer.start();
        }
		
		private function onTimer(e:TimerEvent):void 
		{
			driver.noteOn(note_count, voice, 1, 0, 0, 0, true);
			
			note_count++;
			if (note_count > 127) note_count = 0;
		}
    }
}