mute — Mutes/unmutes new instances of a given instrument.


Mutes/unmutes new instances of a given instrument.


mute insnum [, iswitch]
mute "insname" [, iswitch]


insnum -- instrument number. Equivalent to p1 in a score i statement.

insname -- A string (in double-quotes) representing a named instrument.

iswitch (optional, default=0) -- represents a switch to mute/unmute an instrument. A value of 0 will mute new instances of an instrument, other values will unmute them. The default value is 0.


All new instances of instrument inst will me muted (iswitch = 0) or unmuted (iswitch not equal to 0). There is no difficulty with muting muted instruments or unmuting unmuted instruments. The mechanism is the same as used by the score q statement. For example, it is possible to mute in the score and unmute in some instrument.

Muting/Unmuting is indicated by a message (depending on message level).


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

Example 660. Example of the mute opcode.

See the sections Real-time Audio and Command Line Flags for more information on using command line flags.

; Select audio/midi flags here according to platform
-odac   ;;;realtime audio out
;-iadc    ;;;uncomment -iadc if realtime audio input is needed too
; For Non-realtime ouput leave only the line below:
; -o mute.wav -W ;;; for file output any platform

sr = 44100
ksmps = 32
nchnls = 2
0dbfs  = 1

; Mute Instrument #2.
mute 2
; Mute Instrument three.
mute "three"

instr 1

a1 oscils 0.2, 440, 0
   outs a1, a1

instr 2	; gets muted

a1 oscils 0.2, 880, 0
   outs a1, a1

instr three	; gets muted

a1 oscils 0.2, 1000, 0
   outs a1, a1


i 1 0 1
i 2 0 1
i "three" 0 1


See also

Instrument Invocation


New in version 4.22