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

forked from: forked from: How to give slide effect in guitar

/**
 * Copyright gri4on ( http://wonderfl.net/user/gri4on )
 * MIT License ( http://www.opensource.org/licenses/mit-license.php )
 * Downloaded from: http://wonderfl.net/c/abhz
 */

// forked from shohei909's forked from: How to give slide effect in guitar
// forked from UtilZone's How to give slide effect in guitar
package {
    import flash.display.Sprite;
    import flash.events.*;
    import com.bit101.components.*;
    import org.si.sion.*;
    import org.si.sion.sequencer.SiMMLTrack;
    import org.si.sion.utils.SiONPresetVoice;

    public class FlashTest extends Sprite {

        public function FlashTest() {
           driver = new SiONDriver();
           presetVoice = new SiONPresetVoice();
           voice = new SiONVoice();
           voice = presetVoice["valsound.guitar"][1];
           
           driver.setVoice(0, voice);
           for(var i:int=1;i<4;i++ ){
               driver.setEnvelopTable(i, envelopData[i]);
           }
           
           driver.setSamplerData(0, driver.render("%6@0 c8d8e8") );//sound0
           driver.setSamplerData(1, driver.render("%6@0 nt1 c8d8e8") );//sound1
           driver.setSamplerData(2, driver.render("%6@0 nt2 e8d8c8") );//sound2
           driver.setSamplerData(3, driver.render("%6@0 nt3 ed8c8") );//sound3
           
           
           driver.play();

            var btn:PushButton;
            
           //sound0
            btn = new PushButton(this);
            btn.label = "sound0";
            btn.x = 10;
            btn.y = 10
            btn.addEventListener(MouseEvent.CLICK, function(e:MouseEvent):void {
                driver.playSound(0);
            }); 
            
           //sound1
            btn = new PushButton(this);
            btn.label = "sound1";
            btn.x = 10;
            btn.y = 40;
            btn.addEventListener(MouseEvent.CLICK, function(e:MouseEvent):void {
                driver.playSound(1);
            }); 
            
           //sound2
            btn = new PushButton(this);
            btn.label = "sound2";
            btn.x = 10;
            btn.y = 70;
            btn.addEventListener(MouseEvent.CLICK, function(e:MouseEvent):void {
                driver.playSound(2);
            }); 
            
           //sound3
            btn = new PushButton(this);
            btn.label = "sound3";
            btn.x = 10;
            btn.y = 100;
            btn.addEventListener(MouseEvent.CLICK, function(e:MouseEvent):void {
                driver.playSound(3);
            }); 
            
        }
    }
}