SiON
The "SiON" is a sound library featuring ...
- PSG, FM, WaveTable?, PCM and pyhisical modeling sound module emulations
- MML (Music Macro Language) compiler and sequencer
- Sound effectors
But it is now under construction.
svn
swc and asdoc
Demonstration
- SiON tag on Wonderfl
- You can use SiON on "Wonderfl" the AS3 code hosting service .
- MMLTalks
- The MML Hosting service using SiON. You can listen and post various music by SiON software synthesizer.
- FM sound keyboard
- The demonstration with an FM sound module emulation (corresponding to YAMAHA YM2608). Its also uses sound effectors (delay and chorus).
- MML Editor
- The demonstration with MML compiler and sequencer. You can use all commands in the MML reference.
- SiOPM FM sound editor
- The demonstration with the extended software FM sound module "SiOPM". You can load voices of FM sound keyboard (These voices are produced by VAL-SOUND) from a menu "Load".
- javascript bridge
- The demonstration calling SiON from JavaScript?. This bridge is used in MML reference.
Usage
1. The simplest sample
Create new SiONDriver.
var driver:SiONDriver = new SiONDriver();
Call play() to play MML (Music Macro Language).
driver.play("t100 l8 [ccggaag4 ffeeddc4 | [ggffeed4]2 ]2");
2. Event trigger sample
- http://www.libspark.org/svn/as3/SiOPM/trunk/samples/Tutorials/EventTrigger.as
- http://www.libspark.org/svn/as3/SiOPM/trunk/samples/Tutorials/EventTrigger2.as
In the sample1, an MML string is played by play() method directly, but in this sample the SiONData instance is created from MML string by compile() method in advance. This is more efficient way. A String type and a SiONData type can be adopted to the 1st argument of play() method, or in other cases it throws an Error.
mainMelody = driver.compile("%t0,1,1 t100 l8 [ccggaag4 ffeeddc4 | [ggffeed4]2 ]2");
...
driver.play(mainMelody);
Specifying "%t" command In the MML string, the sequencer track will dispatch a SiONTrackEvent on the timing of note-on and note-off.
mainMelody = driver.compile("%t0,1,1 t100 l8 [ccggaag4 ffeeddc4 | [ggffeed4]2 ]2");
driver.addEventListener(SiONTrackEvent.NOTE_ON_FRAME, _onNoteOn);
driver.addEventListener(SiONTrackEvent.NOTE_OFF_FRAME, _onNoteOff);
3. Synchronized play sample
- http://www.libspark.org/svn/as3/SiOPM/trunk/samples/Tutorials/SyncSequence.as
- http://www.libspark.org/svn/as3/SiOPM/trunk/samples/Tutorials/SyncSequence2.as
A SiONVoice is for the setting of tone voice. You can get some preset voice from sion.utils.SiONPresetVoice instance. Please refer the source if you want to know more.
public var presetVoice:SiONPresetVoice = new SiONPresetVoice(); ... voice = presetVoice["valsound.piano8"];
A sequenceOn() method plays a sequence synchlonized with the other sequence played by play() method. The 1st argument sets SiONData of playing sequence, the 2nd argument sets the tone voice (you can also specify null here), the 3rd argument sets a length to play (In the case of 0, plays all of sequence), the 4th argument sets delay and the 5th argument sets quantizing timing to synchlonize. The 3,4,5th arguments uints are beats in 16th (In this sample, the 5th argument of "2" sets synchlonization with a beat in 8th.
private function _onClick(e:Event) : void {
driver.sequenceOn(clickSequence, voice, 0, 0, 2);
}
Or, the SiONDriver also has noteOn() method that plays one note instead of sequence. The 1st argument is note number (o5c = 60).
driver.noteOn(60, voice, 0, 0, 2);
4. Others are on going
- http://www.libspark.org/svn/as3/SiOPM/trunk/samples/Tutorials/NoteOnException.as
- http://www.libspark.org/svn/as3/SiOPM/trunk/samples/Tutorials/FadeInOut.as
- http://www.libspark.org/svn/as3/SiOPM/trunk/samples/Tutorials/CustomFader.as
- http://www.libspark.org/svn/as3/SiOPM/trunk/samples/Tutorials/RenderWave.as
- http://www.libspark.org/svn/as3/SiOPM/trunk/samples/Tutorials/TimerInteruption.as
- http://www.libspark.org/svn/as3/SiOPM/trunk/samples/SiONKaosPad/KaosPad.as
- http://www.libspark.org/svn/as3/SiOPM/trunk/samples/SiONKaosillator/Kaosillator.as
- http://www.libspark.org/svn/as3/SiOPM/trunk/samples/SiONTenorion/Tenorion.as
License
License
-------
Copyright (c) 2009 Kei Mesuda (keim) All rights reserved.
Redistribution and use in source and binary forms,
with or without modification, are permitted provided that
the following conditions are met:
1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Codes
Source
Samples
- tutorial samples
- SiOPM JavaScript bridge
- FM sound module keyboard
- SiON KaosPad
- SiON Kaosillator
- SiON Tenorion

