Sequencing

There are currently three sequencers included with Gibber. The first, the Seq object, is the basis for the ScaleSeq and Arp (Arpeggiator) objects. It also provides the sequencing capabilities for the Drums object.

Seq

Seq is a generic sequencer that can be used to sequence the following:

  • Changes to parameters of JavaScript objects, including Gibber synths, fx and modulators
  • Calls to methods on JavaScript objects, again including those found in Gibber
  • Execution of anonymous or named JavaScript functions

This provides a great deal of flexibility. For example, a Seq object can control changes to note patterns, volume changes, tempo changes, changes to the background color of the editor… basically anything you can think of that is exposed in JavaScript.

The Seq object accepts three arguments in its constructor; the first is a mandatory argument that defines the values to be sequenced. The second is how often the sequencer advances from one object to the next; this defaults to a quarter note. The final argument is what method or property should be sequenced on any slave objects. Below are some examples of using the Seq object:

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
s = Synth(); // create a synth
 
// sequence a four note phrase
seq = Seq(["A4", "B4", "C4", "C#4"], _4);
 
// tell the sequencer to control the synth. Using introspection,
// the sequencer knows it should call the note method of the
// synth
seq.slave(s);
 
// Create a sequencer that randomizes the notes found in seq
// at the start of every measure
seq2 = Seq([seq.shuffle], _1);
 
// Create a sequencer that changes the attack of the synth
// every quarter note
seq3 = Seq([10, 100, 250], _4, "attack");
seq3.slave(s);
view raw seq.js This Gist brought to you by GitHub.

The Seq object has a number of useful methods and properties:

  • speed – changes the rate that the sequencer advances
  • set(newArray) – assign a new array of values to be sequenced
  • shuffle() – randomizes order of values in sequencer
  • reset() – restores original order of sequenced values
  • stop() – stops sequencer and sets position to 0
  • pause() – stops sequencer but does not reset position
  • play() – trigger playback of sequence

ScaleSeq

The ScaleSeq has possesses the same methods and properties as the Seq object, however, its intended use is to sequence notes in a given scale. When you create a ScaleSeq, it looks at two global properties in the Gibber object: Gibber.mode and Gibber.root. Mode determines what mode (aeolian, phrygian, lydian etc.) to use while root determines the base note for the scale. The ScaleSeq object then sequences offsets from this base note in the defined mode. For example, given the following:

Gibber.root = "C4";
Gibber.mode = "aeolian";
s = ScaleSeq([0,1,4,2]);

… the scale sequence will output the notes C4, D4, G4 and Eb4.

You can change the root key and mode of any ScaleSeq object by setting the appropriate properties (root and mode). For details on this see the “scales + theory” tutorial included in the Gibber environment.

Arp

The Arpeggiator object is a convenience object for sequencing the notes of a chord. You can learn more about the Arp and using chords in Gibber by checking out the “chords + arp” tutorial in the Gibber environment. The Arp’s constructor accepts four parameters:

  • chord – The name and octave of the chord to be arpeggiated. For example “C4m7″ or “Db3maj7″.
  • duration – The number of samples each note should last, normally specified using Gibber duration variables such as _4, _8, _16 etc.
  • mode – There are currently three modes for arpeggio sequences:
    • “up” – play the notes traveling upwards and then jump back to the root note
    • “down” – start from the top of the chord and play down, jump back to top after reaching the root
    • “updown” – play notes going up and then going down
  • octaves – the number of octaves to arpeggiate the chord over. Default is 1.

The Arpeggiator can sequence raw oscillators or any of the various synth objects. Below is an example of Arp use:

s = Sine();
a = Arp("C4m7", _16, "updown", 2);
a.slave(s);
This work is licensed under GPL - 2009 | Powered by Wordpress using a heavily modified version of the theme aav1