My favorites | Sign in
Project Home Downloads Wiki Issues Source
Project Information
Members
Featured
Downloads
Links

FEATURES:

MIDIFlash allows you to send MIDI signals with ActionScript 3 (Flash)

MIDIFlash basically sends OSC packets to a XML Socket Server (FLOSC). The FLOSC server has a output port that transforms the XML/OSC messages back to MIDI. MIDIFlash uses a app called “Occam” for the MIDI transformation.

You can download FLOSC here, Occam can be found here

MIDIFlash includes OSC classes from DustyPixels (no need to download, they are included.)

Demo of the API:

import com.thirtyOne.prototypes.MIDI.MIDIGateway;


// MIDIGateway(_SERVER_IP:String, _FLOSC_PORT:Number, _OCCAM_PORT:Number, _CALLBACK:Function):void


// sendMIDI(_note:uint, _duration:Number, _velocity:Number):void		
// holdMIDI(_note:uint, _velocity:uint):void	
// releaseMIDI(_note:uint, _velocity:uint):void

Demo of a working version:

package{
	//stay hungry
	//stay foolish

	// FLASH
	
	import flash.events.TimerEvent;
	import flash.utils.Timer;
	import flash.display.*;
	
	// THIRTYONE
	
	import com.thirtyOne.prototypes.MIDI.MIDIGateway;
	
	public class Main extends Sprite{
		
		private var _MIDIGateway		:MIDIGateway;
		
		public function Main(){
			_MIDIGateway = new MIDIGateway("ZION.local", 3333, 57117, gatewayConnected);
		}
		
		private function gatewayConnected():void{		
			var myTimer:Timer=new Timer(1000);
			myTimer.addEventListener("timer", sendRandomNote);
			myTimer.start();
			
			var MY_NOTE:uint = 40;
			
			function sendRandomNote(e:TimerEvent):void {
				
				// CALL THE GATEWAY:
				_MIDIGateway.sendMIDI(MY_NOTE, 1, 1);
				
				if(MY_NOTE<100){
					MY_NOTE++;
				}else{
					MY_NOTE = 40;
				}
			}
		}
	}
}
Powered by Google Project Hosting