ftlptim

ftlptim — Returns the loop segment start-time of a stored function table number.

Description

Returns the loop segment start-time of a stored function table number.

Syntax

ftlptim(x) (init-rate args only)

Performance

Returns the loop segment start-time (in seconds) of stored function table number x. This reports the duration of the direct recorded attack and decay parts of a sound sample, prior to its looped segment. Returns zero (and a warning message) if the sample does not contain loop points.

Examples

Here is an example of the ftlptim opcode. It uses the file ftlptim.csd, and mary.wav.

Example 174. Example of the ftlptim opcode.

See the sections Real-time Audio and Command Line Flags for more information on using command line flags.

<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 ftlptim.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
  ; Print out the loop-segment start time in Table #1.
  itim = ftlptim(1)
  print itim
endin


</CsInstruments>
<CsScore>

; Table #1: Use an audio file, Csound will determine its size.
f 1 0 0 1 "mary.wav" 0 0 0

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


</CsScore>
</CsoundSynthesizer>


Since the audio file “mary.wav” is non-looping, its output should include lines like this:

WARNING: non-looping sample
instr 1:  itim = 0.000
      

See Also

ftchnls, ftlen, ftsr, nsamp

Credits

Author: Barry L. Vercoe
MIT
Cambridge, Massachussetts
1997

Example written by Kevin Conder.