changed

changed — Détecteur de changement d'un signal de taux-k.

Description

Cet opcode renvoie un signal de déclenchement indiquant tout changement d'un de ses arguments de taux-k. Utile avec les widgets valuateurs ou les contrôleurs MIDI.

Syntaxe

ktrig changed kvar1 [, kvar2,..., kvarN]

Exécution

ktrig - Renvoie la valeur 1 lorsqu'un des signaux de taux-k a changé, sinon renvoie la valeur 0.

kvar1 [, kvar2,..., kvarN] - variables de taux-k dont les changements sont surveillés.

Exemples

Voici un exemple de l'opcode changed. Il utilise le fichier changed.csd.

Exemple 102. Exemple de l'opcode changed.

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

sr = 44100
ksmps = 32
nchnls = 2

instr 1

ksig  oscil 2, 0.5, 1
kint  = int(ksig)
ktrig changed kint
      printk 0.2, kint
      printk2 ktrig

endin

</CsInstruments>
<CsScore>
f 1 0 1024 10 1
i 1 0 20

e
</CsScore>
</CsoundSynthesizer>


Its output should include lines like:

 i   1 time     0.00267:     0.00000
 i1     0.00000
 i1     1.00000
 i1     0.00000
 i   1 time     0.20267:     1.00000
 i   1 time     0.40267:     1.00000
 i1     1.00000
 i1     0.00000
 i   1 time     0.60267:     1.00000
 i   1 time     0.80267:     1.00000
 i1     1.00000
 i1     0.00000
 i   1 time     1.00000:     0.00000
 i1     1.00000
 i1     0.00000
 i   1 time     1.20267:    -1.00000
 i   1 time     1.40267:    -1.00000
 i1     1.00000
 i1     0.00000
 i   1 time     1.60267:    -1.00000
 i   1 time     1.80000:    -1.00000
 i1     1.00000
 i1     0.00000
 i   1 time     2.00000:    -0.00000
 i1     1.00000
 i1     0.00000
 .........

Crédits

Ecrit par Gabriel Maldonado.

Exemple écrit par Andrés Cabrera.

Nouveau dans Csound 5. (N'était disponible auparavant que dans CsoundAV)