Abstract-Codex | | index | | works | | bio | |> memory | | network | | contact |
import tactu5.*; import tactu5.Tactu5SimpleSequencer; // creating an instance of Tactu5 Tactu5 tactu5; // creating an aggregator instance Aggregator aggregator; void setup() { Tactu5Utilities tactu5utilities = new Tactu5Utilities(); // define various frequencies float freqA = 440.000; float freqC = tactu5utilities.noteToFreq ( T5Notes.C, 4 ); float freqE = tactu5utilities.noteToFreq ( T5Notes.E, 4 ); float freqG = tactu5utilities.noteToFreq ( T5Notes.G, 3 ); // declaring some notes Note noteA = new Note(freqA,200,1,1,100,false); Note noteC = new Note(freqC,200,1,1,100,false); Note noteE = new Note(freqE,200,1,1,100,false); Note noteG = new Note(freqG,200,1,1,100,false); // declaring a sequence Sequence sequence = new Sequence(); // add notes to sequence to create an arpeggio sequence.addNote(noteA); sequence.addNote(noteC); sequence.addNote(noteE); sequence.addNote(noteG); aggregator = new Aggregator(); //add the sequence to aggregator aggregator.addSequence(sequence); // initializing and feed internal sequencer, boolean value inidicate if it will loop tactu5 = new Tactu5(this,aggregator.getScore(),true); // start sequencer tactu5.start(); } void draw() { // do something } void noteReciver(Note n){ // now you have to send data to a synth println(n.getFrequency()); } void stop() { // eliminate Tactu5 sequencer tactu5.closeSequencer(); super.stop(); } Sequence class allows to create musical phrases or patterns with Tactu5. It's possible to pass an array of Note to the constructor or to add Note objects afterwards. This class automatically clones the Note objects passed. Sequence() Sequence(Note[] inseq) inseq .................Note[] an array of Note Web and application. Note ClusterSequence Aggregator > addNote() > getContainerNum() > getDuration() > getFrequency() > getNote() > getPan() > getSequence() > getSequenceLength() > getSequenceMilliSec() > getSustain() > getTimeAtStep() > getVelocity() > scaleDuration() > scaleSustain() > setChannel() > setDuration() > setFrequency() > setPan() > setSustain() > setVelocity() > updateTime() addNote() Get the channel number, channel value is arbitray. It means you could get a value and use it to identify a synth, an action or anything else. sequence.addNote(Note inote); int ^ up getContainerNum() Under Construction. sequence.getContainerNum(); int ^ up getDuration() Return a float array with all duration values in the sequence. sequence.getDuration(); float[] ^ up getFrequency() Return a float array with all frequency values in the sequence. sequence.getFrequency() ; float[] ^ up getNote() Return a specific note of the sequence. sequence.getNote(int index); Note ^ up getPan() Return a float array with all pan values in the sequence. sequence.getPan(); float[] ^ up getSequence() Return the internal array of Note objects. sequence.getSequence() ; Note[] ^ up getSequenceLength() Return the number of sequence notes. sequence.getSequenceLength() ; int ^ up
|
||||||
<<
back^page-up |
||||||
> memory >Tactu5 | ||||||