exp

exp — Retourne e élevé à la puissance x.

Description

Retourne e élevé à la puissance x.

Syntaxe

exp(x) (pas de restriction de taux)
exp(k/i[]) (k- ou i-tableau)

où l'argument entre parenthèses peut être une expression. Les convertisseurs de valeur effectuent une transformation arithmétique d'unités d'une sorte en unités d'une autre sorte. Le résultat peut devenir ensuite un terme dans une autre expression.

Exemples

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

Exemple 276. Exemple de l'opcode exp.

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
-odac     ;;;realtime audio out
;-iadc    ;;;uncomment -iadc if realtime audio input is needed too
; For Non-realtime ouput leave only the line below:

</CsOptions>
<CsInstruments>

; By Stefano Cucchi 2020

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


instr 1
i1 = exp(2) 
; BASE = e (2,71828 18284 59045 23536...)
; EXPONENT = 2
print i1
endin



</CsInstruments>
<CsScore>
i 1 0 1
e
</CsScore>
</CsoundSynthesizer>


Sa sortie contiendra des lignes comme celles-ci :

new alloc for instr 1:
instr 1:  i1 = 7.389
B  0.000 ..  1.000 T  1.000 TT  1.000 M:  0.00000  0.00000
  .........

Voici un autre exemple de l'opcode exp. Il utilise le fichier exp-musical.csd.

Exemple 277. Exemple musical de l'opcode exp.

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
-odac     ;;;realtime audio out
;-iadc    ;;;uncomment -iadc if realtime audio input is needed too
; For Non-realtime ouput leave only the line below:

</CsOptions>
<CsInstruments>

; By Stefano Cucchi 2020

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


instr 1
i1 = exp(2) 
; BASE = e (2,71828 18284 59045 23536...)
; EXPONENT = 2
print i1
endin



</CsInstruments>
<CsScore>
i 1 0 1
e
</CsScore>
</CsoundSynthesizer>


Sa sortie contiendra des lignes comme celles-ci :

Generated events per second: 1
  rtevent:	   T  0.000 TT  0.000 M:  0.00000  0.00000
new alloc for instr 10:
  rtevent:	   T  0.811 TT  0.811 M:  0.48906  0.48906
new alloc for instr 10:
Generated events per second: 2
  rtevent:	   T  1.387 TT  1.387 M:  0.48611  0.48611
  rtevent:	   T  1.833 TT  1.833 M:  0.48421  0.48421
Generated events per second: 3
  rtevent:	   T  2.198 TT  2.198 M:  0.47536  0.47536
  rtevent:	   T  2.506 TT  2.506 M:  0.46530  0.46530
  rtevent:	   T  2.773 TT  2.773 M:  0.44986  0.44986
Generated events per second: 4
  rtevent:	   T  3.009 TT  3.009 M:  0.48096  0.48096
  .........

Voir aussi

abs, frac, int, log, log10, i, sqrt

Nouveau dans la version 4.21