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

Tactu5.
A Processing music assistant.


<< back to Tactu5 index

Name:

Sequence

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 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();
  
}
		
Description:

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.

Constructor syntax:

Sequence()
Sequence(Note[] inseq)


Parameters:

inseq .................Note[] an array of Note

Usage:

Web and application.

Releated:

Note ClusterSequence Aggregator

Methods:

> addNote()
> getContainerNum()
> getDuration()
> getFrequency()
> getNote()
> getPan()
> getSequence()
> getSequenceLength()
> getSequenceMilliSec()
> getSustain()
> getTimeAtStep()
> getVelocity()
> scaleDuration()
> scaleSustain()
> setChannel()
> setDuration()
> setFrequency()
> setPan()
> setSustain()
> setVelocity()
> updateTime()




Name: addNote()

Description:

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.

Syntax:

sequence.addNote(Note inote);

Return: int


^ up


Name:
getContainerNum()

Description:

Under Construction.

Syntax:

sequence.getContainerNum();

Return: int


^ up


Name: getDuration()

Description:

Return a float array with all duration values in the sequence.

Syntax:

sequence.getDuration();

Return: float[]


^ up

Name:
getFrequency()

Description:

Return a float array with all frequency values in the sequence.

Syntax:

sequence.getFrequency() ;

Return: float[]


^ up


Name:
getNote()

Description:

Return a specific note of the sequence.

Syntax:

sequence.getNote(int index);

Return: Note


^ up


Name: getPan()

Description:

Return a float array with all pan values in the sequence.

Syntax:

sequence.getPan();

Return: float[]


^ up


Name: getSequence()

Description:

Return the internal array of Note objects.

Syntax:

sequence.getSequence() ;

Return: Note[]


^ up

Name:
getSequenceLength()

Description:

Return the number of sequence notes.

Syntax:

sequence.getSequenceLength() ;

Return: int


^ up

Name: getSequenceMilliSec()

Description:

Return the sequence duration in milliseconds.

Syntax:

sequence.getSequenceMilliSec() ;

Return: float


^ up

Name: getSustain()

Description:

Return a float array with all sustain values in the sequence.

Syntax:

sequence.getSustain() ;

Return: float[]


^ up

Name: getTimeAtStep()

Description:

Return the time interval in milliseconds from the sequence begining to a specific elements of the internal array.

Syntax:

sequence.getTimeAtStep(int n) ;

Return: float


^ up

Name: getVelocity()

Description:

Return a float array with all velocity values in the sequence.

Syntax:

sequence.getVelocity();

Return: float[]


^ up

Name: scaleDuration()

Description:

This method modifies all events duration in the sequence multipling them for a coefficent.

Syntax:

sequence.scaleDuration(float coefficient) ;

Return: nothing


^ up

Name: scaleSustain()

Description:

This method modifies all events duration in the sequence multipling them for a coefficent.

Syntax:

sequence.scaleSustain(float coefficient) ;

Return: nothing


^ up

Name: setChannel()

Description:

Set a channel id for all the sequence element.

Syntax:

sequence.setChannel(int inValue);
sequence.setChannel(int[] inArray);

Return: nothing


^ up

Name: setDuration()

Description:

Set all the duration values of internal Note array.

Syntax:

sequence.setDuration(float inValue) ;
sequence.setDuration(float[] inArray);


Return: nothing


^ up

Name: setFrequency()

Description:

Set all the duration values of internal Note array.

Syntax:

sequence.setFrequency(float inValue) ;
sequence.setFrequency(float[] inArray) ;


Return: nothing


^ up

Name: setDuration()

Description:

Set all the duration values of internal Note array.

Syntax:

sequence.setDuration(float inValue) ;
sequence.setDuration(float[] inArray);


Return: nothing


^ up

Name: setPan()

Description:

Set all the pan values of internal Note array.

Syntax:

sequence.setPan(float inValue) ;
sequence.setPan(float[] inArray) ;


Return: nothing


^ up

Name: setDuration()

Description:

Set all the duration values of internal Note array.

Syntax:

sequence.setDuration(float inValue);
sequence.setDuration(float[] inArray);


Return: nothing


^ up

Name: setSustain()

Description:

Set all the sustain values of internal Note array.

Syntax:

sequence.setSustain(float inValue);
sequence.setSustain(float[] inArray);


Return: nothing


^ up

Name: setVelocity()

Description:

Set all the velocity values of internal Note array.

Syntax:

sequence.setVelocity(float inValue);
sequence.setVelocity(float[] inArray);


Return: nothing


^ up

 

 





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