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 noteReceiver(Note n){ // send data to a synth println(n.getFrequency()); Class Note defines a single sound event. It's possible to create a new instance of the object passing a variable numbers of parameters. Though some parameters could seem arbitrary, because Tactu5 does not implement any sound generator, using them in the suggested way allows to utilize properly some advanced methods. Note(float d, boolean r); Note(float d, boolean r, String c); Note(float f, float d): Note(float f, float d, float p); Note(float f, float d, float p, boolean r); Note(float f, float d, float p, float v, float s, boolean r); Note(float f, float d, float p, float v, float s, boolean r, String c, int ch); f.................float frequency in hz d................float duration in milliseconds s................float sustain in milliseconds p................float pan (arbitrary value) v................float velocity (arbitrary value) ch...............int channel c................String comment r................booelan, is a rest? Web and application. Sequence > getChannel() > getComment() > getDuration() > getFrequency() > getPan() > getSustain() > getVelocity() > invertRest() > isThisARest() > setChannel() > setComment() > setDuration() > setFrequency() > setPan() > setSustain() > setVelocity() getChannel() 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. note.getChannel(); int ^ up getComment() Get a comment. note.getCommentl(); String ^ up getDuration() Get the duration value in milliseconds. note.getDuration(); float ^ up getFrequency() Get the frequency value in Hz. note.getFrequency() ; float ^ up getPan() Get the pan value. It's an arbitrary value to define panpotting. note.getFrequency() ; float ^ up getSustain() Get the sustain value in milliseconds. note.getSustain() ; float ^ up getVelocity() Get the velocity value. note.getVelocity() ; float ^ up invertRest() Invert the boolean value for identify a rest. note.invertRest() ; nothing ^ up
|
||||||
<<
back^page-up |
||||||
> memory >Tatu5 | ||||||