...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 ‘learning’

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

WordPress problem solved!

Posted on: November 26th, 2010

ran into a huge problem with wordpress today as I tried to get a list of blog entries from certain categories excluding others, well that´s solved now.