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練習その5 その他音源でのMML再生

以下のサイトを参考にさせてもらいました
SiOPM MML reference (version 0.6.0)
http://mmltalks.appspot.com/document/siopm_mml_ref_05.html
UI Sound with SiON
http://blog.r3c7.net/?p=406
/**
 * Copyright siouxcitizen ( http://wonderfl.net/user/siouxcitizen )
 * MIT License ( http://www.opensource.org/licenses/mit-license.php )
 * Downloaded from: http://wonderfl.net/c/d6r5
 */

// forked from siouxcitizen's SiON練習その4 FC音源?でMML再生
//以下のサイトを参考にさせてもらいました
//
//SiOPM MML reference (version 0.6.0)
//http://mmltalks.appspot.com/document/siopm_mml_ref_05.html
//
//UI Sound with SiON
//http://blog.r3c7.net/?p=406
package {
    import flash.display.Sprite;
    import org.si.sion.*;
    import com.bit101.components.*;
    import flash.events.MouseEvent;
    public class SiONRensyu extends Sprite {
        public var driver:SiONDriver = new SiONDriver();
        public var mainMelody:SiONData;
        function SiONRensyu() {
            var mml:String = "t100;";
            //音色定義(%5, @1 = のこぎり波(upward saw))
            mml += "%5@1 l8 [cdefgab<c r c>bagfedc]1;";
            //音色定義(%5, @6 = ホワイトノイズ)
            mml += "%5@6 l8  grrrrrrr  r  grrrrrrr;";
        	    mainMelody = driver.compile(mml);
        	    new PushButton(this, 10, 20, "play", mml_play);
        	    new PushButton(this, 150, 20, "stop", mml_stop);
        }        
        private function mml_play(e:MouseEvent):void{
			driver.play(mainMelody);
        }
		private function mml_stop(e:MouseEvent):void{
			driver.stop();
		}
    }
}