ftsr

ftsr --  Returns the sampling-rate of a stored function table.

Description

Returns the sampling-rate of a stored function table.

Syntax

ftsr(x) (init-rate args only)

Performance

Returns the sampling-rate of a GEN01 generated table. The sampling-rate is determined from the header of the original file. If the original file has no header or the table was not created by these GEN01, ftsr returns 0. New in Csound version 3.49.

Examples

Here is an example of the ftsr opcode. It uses the files ftsr.orc, ftsr.sco, and mary.wav.

Example 1. Example of the ftsr opcode.

/* ftsr.orc */
/* Written by Kevin Conder */
; Initialize the global variables.
sr = 44100
kr = 4410
ksmps = 10
nchnls = 1

; Instrument #1.
instr 1
  ; Print out the sampling rate of Table #1.
  isr = ftsr(1)
  print isr
endin
/* ftsr.orc */
        
/* ftsr.sco */
/* Written by Kevin Conder */
; Table #1: Use an audio file.
f 1 0 262144 1 "mary.wav" 0 0 0

; Play Instrument #1 for 1 second.
i 1 0 1
e
/* ftsr.sco */
        
Since the audio file "mary.wav" uses a 44.1 Khz sampling rate, its output should a line like this:
instr 1:  isr = 44100.000
      

See Also

ftchnls, ftlen, ftlptim, nsamp

Credits

Authors: Barry L. Vercoe

MIT

Cambridge, Massachussetts

1997

Gabriel Maldonado (ftsr, nsamp)

Italy

October, 1998

Chris McCormick (ftchnls)

Perth, Australia

December 2001