getHeaderInfo: Get the header specifications of a Csound instance

Description Usage Arguments Value

View source: R/getHeaderInfo.R

Description

The header of the csound orchestra declares various important variables including the sample rate, the number of audio samples per control period, the number of output channels, and the maximum amplitude value. This function queries a Csound instance and returns the information in a list.

Usage

1
  getHeaderInfo(csInstance)

Arguments

csInstance

An instance of Csound, created by csoundCreate.

Value

getHeaderInfo() returns a list with the following elements:

$sample rate, abbreviated as

1
sr

in the orchestra header. is the number of data points (‘samples’) per second used to represent a sound. The default is 44100 Hz, which is CD-quality.

$ksmps is the number of samples in a control period, which must be an integer. Csound allows one to control an audio signal at a rate below that of the audio rate (i.e. the control rate or $kr), useful for things such as creating an envelope for sounds; using a lower-than-audio rate uses less processing power for what is often the same audio effect. Higher values of

1
ksmps

indicate a slower control rate;

1
ksmps=1

means audio rate. A typical

1
ksmps

is 10.

$x0dbfs is the maximum amplitude value–specified amplitude values are scaled between 0 and this number.

1
0dbfs

is short for Zero Decibels at Full-Scale Amplitude. A common value is 1; if not specified in the file, the default is 32768.

$nchnls is the number of output channels specified; 1 is mono output, 2 stereo, etc.

If the orchestra has been compiled, these should match the header in the orchestra; if no orchestra has been compiled, getHeaderInfo() simply returns the defaults.


csound documentation built on May 2, 2019, 5:46 p.m.

Related to getHeaderInfo in csound...