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練習その4 FC音源?でMML再生

参考
SiOPM MML reference (version 0.6.0)
http://mmltalks.appspot.com/document/siopm_mml_ref_05.html
/**
 * Copyright siouxcitizen ( http://wonderfl.net/user/siouxcitizen )
 * MIT License ( http://www.opensource.org/licenses/mit-license.php )
 * Downloaded from: http://wonderfl.net/c/zh4l
 */

// forked from siouxcitizen's SiON練習その3 2種類MML同時再生
//参考
//SiOPM MML reference (version 0.6.0)
//http://mmltalks.appspot.com/document/siopm_mml_ref_05.html
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;";
            mml += "%1@2 l8 [cdefgab<c r c>bagfedc]1;";
            mml += "%1@4 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();
		}
    }
}