Yesterday I was slicing up some breaks in a variety of ways and chaining them together into sequences like this:
d1 $ cat [
slice 8 "0 1 2 3 4 5 6 7" $ sound "brk:1",
slice 8 "0 1 2 0 1 2 5 [6 6]" $ sound "brk:1",
slice 8 "0 1 [2 2 2 2] 0 1 2 6 6" $ sound "brk:1",
slice 8 "0 1 2 0 1 2 0 0" $ sound "brk:1",
slice 8 "0 1 2 ~ 4 4 [6 6] 7" $ sound "brk:1",
slice 8 "0 1 2 0 1 2 5 [6 6]" $ sound "brk:1",
slice 8 "0 1 [2 2 4 [~ 4]] 0 1 2 6 6" $ sound "brk:1",
slice 32 "[0 1 2 0 1 2 6 6]/4" $ sound "brk:1"
]
Is there a more idiomatic way of doing this - the slice 8
and sound "brk:1"
are quite repetitive - could I extract a function here? Or should I turn off my programmer brain and enjoy the repetition ?