Performance format

barryvan edited this page Nov 12, 2011 · 2 revisions
Clone this wiki locally

Once you've instantiated a controller, you need to pass an object describing the piece to be performed to its "perform" method.

{
  title: 'The title',
  composer: 'The composer',
  url: 'The URL',
  audio: 'The audio file (including extension at present)',
  comment: 'A comment',
  
  tempo: 110, // The tempo of the piece in BPM
  beatRows: 8, // The number of "rows" or "ticks" which make up a beat
  measureRows: 32, // The number of "rows" or "ticks" which make up a full measure

  prefilters: [
    {
      filter: barryvan.tp.filter.Pick, // Not instantiated
      options: { }, // Options to be passed when instantiating the filter
    }
  ],
  
  postfilters: [
    {
      filter: barryvan.tp.filter.FPS,
      options: { }
    }
  ],

  instruments: [
    {
      name: 'The name of the instrument',
      performers: [
        {
          performer: barryvan.tp.performer.Oscillator, // Not instantiated
          options: { } // Options to be passed when instantiating the performer
        }, ...
      ]
    }, ...
  ],
  
  patterns: [
    {
      name: 'The name of the pattern',
      rows: [ // Each element of this array represents a "row" or "tick". Empty rows must still be included.
        [ // Each element of this array represents a note
          {
            note: 64, // The note number, counting from C-0 => 0. Note off => -1; Note cut => -2.
            instrument: 1, // The instrument performing this note (indexed from 1, not 0).
            volume: 49, // The volume (maximum 64)
            bend: -9, // Pitch bend (-9 to 9). Volume and bend are mutually exclusive.
          }, ...
        ], ...
      ], ...
    }, ...
  ]
}