Click or drag to resize

TimbreOrgan Method

Generates a simulated organ note for the given frequency and time.

Namespace: GSF.Media.Music
Assembly: GSF.Media (in GSF.Media.dll) Version: 2.4.218-beta
Syntax
public static double Organ(
	double frequency,
	long sampleIndex,
	long samplePeriod,
	int sampleRate
)
View Source

Parameters

frequency  Double
Fundamental frequency of the desired note in Hz.
sampleIndex  Int64
Sample index (represents time anywhere from zero to full length of song).
samplePeriod  Int64
If useful, total period for note in whole samples per second (i.e., seconds of time * sampleRate) over which to compute timbre.
sampleRate  Int32
Number of samples per second.

Return Value

Double
The amplitude for a simulated clarinet note at the given time.
Remarks
This method computes an amplitude representing the acoustic pressure of a second-order harmonic series approaching a square wave (i.e., Sin(f) + Sin(3f)/3) of the given frequency for the given time to simulate an organ sound.
See Also