Skip to content

splice

Splices the performance list and modifies the position of an instrument in the list order at i-time.

Syntax

err:i = splice(inst1:Instr,inst2:Instr,mode:i) 
err:i splice inst1:Instr,inst2:Instr,mode:i

Initialization

var -- error code (0 = no error).

inst1 -- instance to be acted on.

inst2 -- reference instance

mode -- 0 to place the instance before the reference, 1 to place it after.

The first instance is placed in the performance list immediately after or before the second instance (used as a reference)

Examples

Here is an example of the splice opcode. It uses the file create.csd.

Examples of the splice opcode.
<CsoundSynthesizer>
<CsOptions>
-n
</CsOptions>
<CsInstruments>
0dbfs = 1

instr 1
    inst@global:Instr = this
    printk2 1
endin

instr 2
   err:i = splice(inst,this,1)
   printk2 2
endin

;schedule(10,0,1)
</CsInstruments>
<CsScore>
f0 3
i1 0 1
i2 0 1
</CsScore>
</CsoundSynthesizer>

Credits

Author: Victor Lazzarini
Maynooth University
Ireland
Csound 7, 2024