dbamp

dbamp — Retourne l'équivalent en décibel de l'amplitude x.

Description

Retourne l'équivalent en décibel de l'amplitude x.

Syntaxe

dbamp(x)  (arguments de taux-i ou -k seulement)

Exemples

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

Exemple 110. Exemple de l'opcode dbamp.

Voir les sections Audio en Temps Réel et Options de la Ligne de Commande pour plus d'information sur l'utilisation des options de la ligne de commande.

<CsoundSynthesizer>
<CsOptions>
; Select audio/midi flags here according to platform
; Audio out   Audio in
-odac           -iadc    ;;;RT audio I/O
; For Non-realtime ouput leave only the line below:
; -o dbamp.wav -W ;;; for file output any platform
</CsOptions>
<CsInstruments>

; Initialize the global variables.
sr = 44100
kr = 4410
ksmps = 10
nchnls = 1

; Instrument #1.
instr 1
  iamp = 30000
  idb = dbamp(iamp)

  print idb
endin


</CsInstruments>
<CsScore>

; Play Instrument #1 for one second.
i 1 0 1
e


</CsScore>
</CsoundSynthesizer>


Sa sortie contiendra cette ligne :

instr 1:  idb = 89.542

Voir Aussi

ampdb, ampdbfs, dbfsamp

Crédits

Exemple écrit par Kevin Conder.