Abstract-Codex | index | works | bio |> memory | network | contact

Tactu5.
A Processing music assistant.


<< back to Tactu5 index

Name:

ClusterSequence

Example:

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 new chords
        
        Cluster chord_1 = new Cluster();
        Cluster chord_2 = new Cluster();
        
        
        chord_1.addNote(noteA);
        chord_1.addNote(noteC);
        chord_1.addNote(noteE);
        
        chord_2.addNote(noteC);
        chord_2.addNote(noteG);
        chord_2.addNote(noteE);
        
        // creating a chord container
        
        ClusterSequence chordSequence = new ClusterSequence();
        
        chordSequence.addCluster(chord_1);
        chordSequence.addCluster(chord_2);
        chordSequence.addCluster(chord_1);
        chordSequence.addCluster(chord_2);
        
        aggregator = new Aggregator();
        
        //add the sequence to aggregator
        
        aggregator.addClusterSequence(chordSequence);
        
        // 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());
 println(n.getDuration());
 println(n.getSustain());
 println(n.getPan());
  
  
  
}
void stop() {
  
  // eliminate Tactu5 sequencer
  tactu5.closeSequencer();
  super.stop();
  
}

Description:

ClusterSequence class allows to create chord sequences with Tactu5. It's possible to pass an array of Cluster datatype to the constructor or to add Cluster objects afterwards. This class automatically clones the Cluster objects passed.

Constructor syntax:

ClusterSequence()
ClusterSequence(Cluster[] inseq)


Parameters:

inseq .................Cluster[] an array of Cluster objects

Usage:

Web and application.

Releated:

Sequence Cluster

Methods:

> addCluster()
> addToCluster()
> getCluster()
> getClusterNumber()
> getTimeAtStep()
> getTotalTime()
> retrogradation()




Name: addCluster()

Description:

Add a Cluster to the sequence array. It's possibile to define the position in the array.

Syntax:

clustersequence.addCluster(Cluster inote);
clustersequence.addCluster(Cluster inote, int pos) ;

Return: nothing


^ up


Name:
addToCluster()

Description:

Add a Cluster to an existing cluster.

Syntax:

clustersequence.addToCluster();

Return: nothing


^ up


Name: getCluster()

Description:

Return the cluster in the specified position.

Syntax:

clustersequence.getCluster(int n) ;

Return: Cluster


^ up

Name:
getClusterNumber()

Description:

Return the number of all clusters inside the sequence.

Syntax:

clustersequence.getClusterNumber() ;

Return: int


^ up


Name:
getTimeAtStep()

Description:

Return the the time in millisecond at the specified event.

Syntax:

clustersequence.getTimeAtStep(int n);

Return: float


^ up


Name: getTotalTime()

Description:

Return the sequence time length.

Syntax:

clustersequence.gteTotalTime();

Return: float


^ up


Name: getSequence()

Description:

Return the internal array of Note objects.

Syntax:

sequence.getSequence() ;

Return: Note[]


^ up

Name:
retrogradation()

Description:

Retrogradation of the sequence.

Syntax:

sequence.getSequenceLength() ;

Return: int


^ up





  << back^page-up
  > memory >Tactu5 > ClusterSequence class