...ndid, the somewhat small but happy love child of Nicolás Delfino. A company specialized in interactive websites and rich media applications, knee deep in actionscript and down with jazz...


Posts Tagged ‘SiON’

SiON – mobile fail…

Posted on: August 15th, 2011

So as I wrote last week I looked into the cool sound framework SiON, hoping that it would work as a sound engine on mobile games

What flash genius Terry Patton predicted was true, the framework – though small in size, is a huge burden on a mobile processor…

Anyway I recommend to check it out at SiON Spark

Flash on! – Nicolas

SiON Sound AS3 – example 1

Posted on: August 5th, 2011

I´ve been playing around a bit with the excellent sound framework made by Kei Mesuda called SiON

This example uses SiON in its simplest way, playing two jazzy chords when the user clicks the stage

Get the swc / source:

To get started you need to head over to SiON Spark

Example 1 – Jazz SiON non standard voice:

Click stage for sound:

// Sample for event trigger
package
{
	import flash.display.*;
	import flash.events.*;
	import org.si.sion.*;
	import org.si.sion.SiONData;
	import org.si.sion.SiONVoice;
	import org.si.sion.utils.SiONPresetVoice;

	public class Sion extends Sprite
	{
		public var composer:SiONDriver = new SiONDriver();
		public var melody:SiONData;
		public var presets:SiONPresetVoice;
		public var voice:SiONVoice;

		private var _on:Boolean = false;

		function Sion()
		{
			stage.addEventListener(MouseEvent.CLICK, playSound);
		}

		private function playSound(e:MouseEvent):void
		{
			var sheet:String;

			if (! _on)
			{
				sheet = "t100;";
				sheet +=  "%3@8 [b+2]1;";
				sheet +=  "%3@8 [f+2]1;";
				sheet +=  "%3@8 [c+2]1;";
				sheet +=  "%3@8 [g2]1;";
				sheet +=  "%3@8 [o2a2]1;";
			}
			else
			{
				sheet = "t100;";
				sheet +=  "%3@8 t100 [b2]1;";
				sheet +=  "%3@8 [e2]1;";
				sheet +=  "%3@8 [c+2]1;";
				sheet +=  "%3@8 [f+2]1;";
				sheet +=  "%3@8 [o3d2]1;";
			}

			presets = new SiONPresetVoice();;
			voice = presets['valsound.bells2'];

			melody = composer.compile(sheet);

			composer.play();
			composer.sequenceOn(melody, voice, 0, 0, 1, 1);

			_on = ! _on;
		}
	}
}

/ Nicolas