| |||||||
Du magst keine Werbung? Wir auch nicht!
Einfach registrieren und die Werbung ist weg. Diese Nachricht sehen nur nicht registrierte Nutzer.
![]() |
| | LinkBack | Themen-Optionen | Ansicht |
| | #16 (permalink) |
| Flash-Designer Registriert seit: May 2006 Ort: Wiesbaden
Beiträge: 6.162
| Kleine Anmerkung damit Du Dich hier nicht gänzlich in die Nesseln setzt: Dieser »Angeber« hat Tonfall programmiert. Wenn sich also irgendjemand damit auskennen sollte, dann er
__________________ Viele Grüße // Martin Martin Kraft // Interaktionsdesign Hilfreiche Websites: // Hilfe zur Adobe Flash Plattform // ActionScript 2 Referenz // ActionScript 3 Referenz // ActionScript 3 Arbeitshandbuch // weitere Flash Ressourcen Bitte keine Flashfragen per PM oder Profilnachricht! Dafür ist das Forum da! |
| | |
| | #17 (permalink) |
| Neuer User Registriert seit: Jan 2003
Beiträge: 8
|
@Martin Kraft Weiss ich doch wollte nur die Stimmung auflockern. ![]() Ich hatte ja von vornherein nach jemandem gefragt, der mit Hilfe von André's Tonfall sowas umsetzen kann, oder eventuell schon rumliegen hat. Die Sachen von André sind ja scheinbar das non-plus-ultra in Sachen Flash&Audio. Zumindest bin ich bei meinen Recherchen immer wieder auf seinen Namen gestoßen -incl. der Kommunikation mit Adobe (make some noise). Und der ganzen seamless-mp3-Files und der Sound_Complete-Problematik. Von daher sitze ich seit dem ersten post in den Nesseln. Das macht aber nix, solange es am Ende eine Lösung gibt. @Mr.Twister Missverständniss: Mein Projekt ist mir nicht peinlich. Die Nummer mit den 10€ schon. |
| | |
| | #18 (permalink) |
| [+] Registriert seit: Dec 2002 Ort: cologne
Beiträge: 2.271
|
Daraus sollten sich konkrete Fragen ergeben. Code: package demo
{
import assets.CasioRZ1;
import test.matrix.MatrixModel;
import test.matrix.MatrixView;
import tonfall.display.AbstractApplication;
import tonfall.prefab.poly.PolySynth;
import flash.events.Event;
/**
* Simple implementation of a Drumcomputer
*
* @author Andre Michelle
*/
[SWF(backgroundColor="#000000", frameRate="31", width="768", height="768")]
public final class DemoDrumcomputer extends AbstractApplication
{
// Pattern
private const matrixModel: MatrixModel = new MatrixModel( 16, CasioRZ1.LIST.length );
private const matrixView: MatrixView = new MatrixView( 32 );
private const generator : PolySynth = new PolySynth( DrumVoiceFactory.INSTANCE );
private const sequencer : DrumSequencer = new DrumSequencer( generator, matrixModel );
public function DemoDrumcomputer()
{
matrixView.model = matrixModel;
addChild( matrixView );
engine.processors.push( sequencer );
engine.processors.push( generator );
engine.input = generator.signalOutput;
}
override protected function resize( event : Event = null ) : void
{
if( null != matrixView )
{
matrixView.x = ( stage.stageWidth - 512 ) >> 1;
matrixView.y = ( stage.stageHeight - 512 ) >> 1;
}
}
}
}
import assets.CasioRZ1;
import test.matrix.MatrixModel;
import tonfall.core.BlockInfo;
import tonfall.core.Memory;
import tonfall.core.Processor;
import tonfall.core.Signal;
import tonfall.core.TimeEvent;
import tonfall.core.TimeEventNote;
import tonfall.format.IAudioDecoder;
import tonfall.prefab.poly.IPolySynthVoice;
import tonfall.prefab.poly.IPolySynthVoiceFactory;
final class DrumSequencer extends Processor
{
private const scale: Number = 1.0 / 16.0;
private var _receiver : Processor;
private var _model : MatrixModel;
public function DrumSequencer( receiver : Processor, model : MatrixModel )
{
_receiver = receiver;
_model = model;
}
override public function process( info : BlockInfo ) : void
{
var index: int = int( info.barFrom / scale );
var position: Number = index * scale;
while( position < info.barTo )
{
if( position >= info.barFrom )
{
for( var i: int = 0 ; i < _model.numRows ; ++i )
{
if(_model.getCellValue( index % _model.numCols, i ) )
{
const event: TimeEventNote = new TimeEventNote();
event.barPosition = position;
event.note = 60 + i;
event.barDuration = 0.0;
_receiver.addTimeEvent(event);
}
}
}
position += scale;
++index;
}
}
}
final class DrumVoice
implements IPolySynthVoice
{
private var _audio: IAudioDecoder;
private var _position: int;
public function start( event: TimeEvent ) : void
{
var noteEvent: TimeEventNote = TimeEventNote( event );
// MAP NOTE EVENT TO SAMPLE
_audio = CasioRZ1.LIST[ ( noteEvent.note - 60 ) % CasioRZ1.LIST.length ];
_position = 0;
}
public function stop() : void
{
// not implemented
}
public function processAdd( current: Signal, numSignals: int ) : Boolean
{
Memory.position = 0;
const read: int = _audio.extract( Memory, numSignals, _position );
Memory.position = 0;
for( var i: int = 0 ; i < read ; ++i )
{
current.l += Memory.readFloat();
current.r += Memory.readFloat();
current = current.next;
}
_position += read;
return read < numSignals;
}
public function dispose() : void {}
}
final class DrumVoiceFactory
implements IPolySynthVoiceFactory
{
public static const INSTANCE: DrumVoiceFactory = new DrumVoiceFactory();
public function create( event: TimeEventNote ) : IPolySynthVoice
{
return new DrumVoice();
}
} |
| | |
![]() |
| Lesezeichen |
| Stichworte |
| as3, audio, gapless, mp3, sequenzer |
| Themen-Optionen | |
| Ansicht | |
| |
Ähnliche Themen | ||||
| Thema | Autor | Forum | Antworten | Letzter Beitrag |
| Workshop: Audio Code Clash (André Michelle) | marc | FFK11 | 0 | 17-01-2011 23:54 |
| Suche simplen "Mind Manager" zum einbinden auf eigener Webseite | Byteground | Am Rande | 0 | 14-01-2010 14:17 |
| [Flash CS3] Suche Flash Audio Player | tukz | Flash Einsteiger | 1 | 27-05-2009 16:06 |
| suche simplen online-texteditor | stifflers mum | Flash MX | 4 | 22-03-2007 08:38 |
| Suche simplen Flash MP3-Player | drops | Flash Einsteiger | 3 | 08-02-2007 19:11 |