Skip to content

Editor's CheatSheet

mohayonao edited this page Mar 5, 2015 · 1 revision
tape1     tape2
┌──────┐  ┌─────────┐
│012345│  │6789abdef│
└──────┘  └─────────┘
concat(...tapes: Tape): Tape
tape = tape1.concat(tape2)
┌──────┐   ┌──────────┐
│012345│ + │6789abcdef│
└──────┘   └──────────┘
┌──────┬──────────┐
│012345│6789abcdef│ concatenate tape fragments
└──────┴──────────┘
slice(startTime: number=0, duration: number=Infinity): Tape
tape = tape.slice(2, 8)
  ┌────┬──────────┐
  │2345│6789abcdef│
  └────┴──────────┘
  ┌────┬────┐
  │2345│6789│  sliced using start time and duration
  └────┴────┘
  
tape.slice(-4)
  ┌────┬─────────┐
  │2345│6789abdef│
  └────┴─────────┘
            ┌────┐
            │bdef│  negative indices start counting from the end
            └────┘
reverse(): Tape
tape = tape.reverse()
┌────┬────┐
│2345│6789│
└────┴────┘
┌────┬────┐
│9867│5432│  inverse
└────┴────┘
loop(n: number=2): Tape
tape = tape.loop(3)
┌────┬────┐   ┌────┬────┐   ┌────┬────┐
│9867│5432│ + │9867│5432│ + │9867│5432│
└────┴────┘   └────┴────┘   └────┴────┘
┌────┬────┬────┬────┬────┬────┐
│9867│5432│9867│5432│9867│5432│  n-times repeat
└────┴────┴────┴────┴────┴────┘
replace(startTime: number, duration: number, tape=null): Tape
tape = tape.replace(2, 15, tape1)
┌──┐    ┌──────┐     ┌───┬────┐
│98│    │012345│     │867│5432│
└──┘    └──────┘     └───┴────┘
┌──┬──────┬───┬────┐
│98│012345│867│5432│  drop using startTime and duration, and insert tape
└──┴──────┴───┴────┘
fill(duration): Tape
tape = tape1.fill(20)
┌──┬──────┬───┬────┐   ┌──┬───┐
│98│012345│867│5432│ + │98│012│
└──┴──────┴───┴────┘   └──┴───┘
┌──┬──────┬───┬────┬──┬───┐
│98│012345│867│5432│98│012│ fill tape fragments until specific duration
└──┴──────┴───┴────┴──┴───┘
split(n: number): Tape[]
tapes = tape.split(4)
┌──┬───┐  ┌───┬──┐  ┌─┬────┐  ┌──┬───┐
│98│012│  │345│86│  │7│5432│  │98│012│  split tape
└──┴───┘  └───┴──┘  └─┴────┘  └──┴───┘
Ciseaux.concat(...tapes: Tape): Tape
tape = Ciseaux.concat(tapes)
┌──┬──────┬───┬────┬──┬───┐
│98│012345│867│5432│98│012│  concatenated by class method
└──┴──────┴───┴────┴──┴───┘
mix(...tapes: Tape, [method='silence']): Tape
tape = tape.mix(tape2, 'fill')
┌──┬──────┬───┬────┬──┬───┐
│98│012345│867│5432│98│012│  mix tapes
├──┴──────┴┬──┴────┴──┼───┤  short tapes are filled until longest duration
│6789abcdef│6789abcdef│678│  method: 'silence', 'fill', 'pitch', 'stretch'
└──────────┴──────────┴───┘
Ciseaux.mix(...tapes: Tape, [method='silence']): Tape
tape = Ciseaux.mix([ tape, tape1 ])
┌──┬──────┬───┬────┬──┬───┐
│98│012345│867│5432│98│012│  mixed by class method
├──┴──────┴┬──┴────┴──┼───┤
│6789abcdef│6789abcdef│678│
├──────┬───┴──────────┴───┤
│012345│                  │
└──────┴──────────────────┘