Pattern Effects

Up until now, most of the functions we’ve seen are what other music programs are typically capable of: sequencing sounds, playing notes, controlling effects.

In this chapter, we are going to look at functions that are more unique to tidal.

reverse patterns with rev

n("0 1 [4 3] 2").sound("jazz").rev()

play pattern left and modify it right with jux

n("0 1 [4 3] 2").sound("jazz").jux(rev)

This is the same as:

stack(
  n("0 1 [4 3] 2").sound("jazz").pan(0),
  n("0 1 [4 3] 2").sound("jazz").pan(1).rev()
)

Let’s visualize what happens here:

stack(
  n("0 1 [4 3] 2").sound("jazz").pan(0).color("cyan"),
  n("0 1 [4 3] 2").sound("jazz").pan(1).color("magenta").rev()
)

Try commenting out one of the two by adding // before a line

multiple tempos

note("c2, eb3 g3 [bb3 c4]").sound("piano").slow("1,2,3")

This is like doing

stack(
  note("c2, eb3 g3 [bb3 c4]").s("piano").slow(1).color('cyan'),
  note("c2, eb3 g3 [bb3 c4]").s("piano").slow(2).color('magenta'),
  note("c2, eb3 g3 [bb3 c4]").s("piano").slow(3).color('yellow')
)

Try commenting out one or more by adding // before a line

add

note("c2 [eb3,g3]".add("<0 <1 -1>>"))
.color("<cyan <magenta yellow>>").adsr("[.1 0]:.2:[1 0]")
.sound("gm_acoustic_bass").room(.5)

If you add a number to a note, the note will be treated as if it was a number

We can add as often as we like:

note("c2 [eb3,g3]".add("<0 <1 -1>>").add("0,7"))
.color("<cyan <magenta yellow>>").adsr("[.1 0]:.2:[1 0]")
.sound("gm_acoustic_bass").room(.5)

add with scale

n("<0 [2 4] <3 5> [~ <4 1>]>*2".add("<0 [0,2,4]>/4"))
.scale("C5:minor").release(.5)
.sound("gm_xylophone").room(.5)

time to stack

stack(
  n("<0 [2 4] <3 5> [~ <4 1>]>*2".add("<0 [0,2,4]>/4"))
  .scale("C5:minor")
  .sound("gm_xylophone")
  .room(.4).delay(.125),
  note("c2 [eb3,g3]".add("<0 <1 -1>>"))
  .adsr("[.1 0]:.2:[1 0]")
  .sound("gm_acoustic_bass")
  .room(.5),
  n("0 1 [2 3] 2").sound("jazz").jux(rev).slow(2)
)

ply

sound("hh, bd rim").bank("RolandTR707").ply(2)

this is like writing:

sound("hh*2, bd*2 rim*2").bank("RolandTR707")

Try patterning the ply function, for example using "<1 2 1 3>"

off

n("<0 [4 <3 2>] <2 3> [~ 1]>"
  .off(1/8, x=>x.add(4))
  //.off(1/4, x=>x.add(7))
).scale("<C5:minor Db5:mixolydian>/4")
.s("triangle").room(.5).ds(".1:0").delay(.5)

In the notation x=>x., the x is the shifted pattern, which where modifying.

off is also useful for sounds:

s("bd sd,[~ hh]*2").bank("CasioRZ1")
  .off(1/8, x=>x.speed(1.5).gain(.25))
namedescriptionexample
revreverse
n("0 2 4 6").scale("C:minor").rev()
juxsplit left/right, modify right
n("0 2 4 6").scale("C:minor").jux(rev)
addadd numbers / notes
n("0 2 4 6".add("<0 1 2 1>")).scale("C:minor")
plyspeed up each event n times
s("bd sd").ply("<1 2 3>")
offcopy, shift time & modify
s("bd sd, hh*4").off(1/8, x=>x.speed(2))