Skip to content

Instantly share code, notes, and snippets.

@charlieroberts
Last active September 25, 2017 00:50
Show Gist options
  • Select an option

  • Save charlieroberts/445f2fb1ce3555f04cffc334c2be0b42 to your computer and use it in GitHub Desktop.

Select an option

Save charlieroberts/445f2fb1ce3555f04cffc334c2be0b42 to your computer and use it in GitHub Desktop.
An proposed API for using the Tidal pattern language in Gibber

Gibber-Tidal

This is a proposed API for using the Tidal pattern language (https://tidalcycles.org/patterns.html) in Gibber. The basic idea is extend Gibber to support calls to .tidal() in addition to its current .seq() method. This would enable any audiovisual property or method to be controlled using Tidal patterns.

// create a synth and sequence it
// using indices into a global scale
a = Synth()
a.note.tidal( '0 [0 [2 3]]' )

// also for graphics or any other av property/method
cube = Cube()
cube.scale.tidal( '1 [2 3]' )

// In Gibber, sequences are stored in an array
// attached to the property or method that the
// sequencer is controlling. By default, they
// are placed into the zero index. So, to change
// the pattern from the above example, we woulc
// access it via a.note[0]
a.note[0].every( 4, 'reverse' )

// but that doesn't work for the following tidal code:

/*** 
d1 $ every 4 (fast 8) $ sound "bd cp" 
***/

// because the arguement 8 would have to be bound to
// the function 'fast'. We could globalize the pattern
// transformations...
a.note[0].every( 4, fast(8) )

// note that the call to 'fast(8)'
// returns a function for future execution.

// these would also be present on the tidal pattern,
// the following would speed up the pattern immediately
a.note[0].fast(4)
a.note[0].linger(.5) // repeat first half of pattenr

// we can chain calls to every(), or anything else, by
// simply having it return the generated tidal pattern
a.note[0]
  .every( 8, fast(4) )
  .every( 2, reverse() )

// c represents current cycle
a.note[0].when( c => c % 4, reverse() )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment