Arithmetic !

This is going to be more fun than it sounds!

Adding patterns of numbers together in Strudel is simple + fun. For example, with โ€˜addโ€™ used to move around notes within a scale:

$: 
note("0 1 2 3 1 0 -2 5"
     .add("<0 4 -4 3>")
     .scale("C:pentatonic")
    ).sound("folkharp")
note("0 1 2 3 1 0 -2 5"
     .off(5/16, x => x.add("<0 4 -4 8>"))
     .scale("C:pentatonic")
    ).sound("folkharp")
    
Try adding .jux(rev) to the above..

You can make long-form melodies by adding together patterns of different lengths:

n("0 1 [- 2] 3 0 - 3 1".add("0 5 2 3 13".pace(4))
  )
.scale("C:mixolydian")
.sound("supersaw")
.room(0.8).sz(2)
._pianoroll() 

If youโ€™re careful, you can also get away with adding notes together directly, without using a particular scale:

note("c2(3,8) c(5,8) d3(5,16) e3(3,8)")
  // .off(0.125, add(note("12")))
  // .off(0.25, add(note("< -7 5 12>")))
  .sound("piano")
  .slow(4)
  .legato(2)
  ._pianoroll()
    
Try uncommenting lines, and then (of course) adding a .jux(rev)

You can use this technique on any pattern of numbers, for example when slicing breakbeats with scrub:

samples('github:sonidosingapura/blu-mar-ten')
s("bmt_breaks:1/2").fit().scrub("0.5@3 0.125@5 0@3 0@1 0.625@2 0.25@2"
                              .add("0 0.125 0.25".pace(8))
                             ).slow(2)

You can use sub, mul and div, for subtraction, multiplication and division respectively, in the same way.