tanh
Prev | Orchestra Opcodes and Operators | Next

## tanh

tanh — Performs a hyperbolic tangent function.

## Description

Returns the hyperbolic tangent of x (x in radians).

## Syntax

    tanh(x) (no rate restriction)

## Examples

Here is an example of the tanh opcode. It uses the files tanh.orc and tanh.sco.

Example 369. Example of the tanh opcode.

    /* tanh.orc */
    ; Initialize the global variables.
    sr = 44100
    kr = 4410
    ksmps = 10
    nchnls = 1

    ; Instrument #1.
    instr 1
      irad = 1
      i1 = tanh(irad)

      print i1
    endin
    /* tanh.orc */

    /* tanh.sco */
    ; Play Instrument #1 for one second.
    i 1 0 1
    e
    /* tanh.sco */

Its output should include a line like this:

    instr 1:  i1 = 0.762

## See Also

cos, cosh, cosinv, sin, sinh, sininv, tan, taninv

## Credits

Author: John ffitch

Example written by Kevin Conder.

Prev | Up | Next
tan | Home | taninv