Nsound Instruments¶
Instruments are classes that provide a common API, their purpose is to provide a foundation of common musical elements for everyone to use.
All Nsound Instruments will provide the following functions:
- Nsound.Instrument.play()
Returns:
- demoNsound.AudioStream
Returns a demo created by the author of the instrument
- Nsound.Instrument.play(duration, frequency)¶
Parameters:
- durationfloat
The duration in seconds of sound to generate
- frequencyfloat
The frequency of the sound in Hz
Returns:
- outNsound.AudioStream
Returns the sound of the instrument at the given
frequency
forduration
seconds
Bass Guitar¶
Based on a physical model written in Csound by Hans Mikelson.
- Nsound.GuitarBass(sample_rate)¶
- sample_ratefloat
The number of samples per seconds
Sample here: GuitarBass.ogg
Clarinet¶
Based on a physical model written in Csound by Hans Mikelson which was originally based on Perry Cook’s physical model.
- Nsound.Clarinet(sample_rate)¶
- sample_ratefloat
The number of samples per seconds
Sample here: Clarinet.ogg
Kick Bass Drum¶
- Nsound.DrumKickBass(sample_rate, high_frequency, low_frequency)¶
- sample_ratefloat
The number of samples per seconds
- high_frequencyfloat
The starting frequency of the drum
- low_frequencyfloat
The stopping frequency of the drum as its response decays
Sample here: DrumKickBass.ogg
BD01 Drum¶
Simulates a bass drum. Based on a Csound drum.
source: http://www.csounds.com/istvan/html/drums.html
- Nsound.DrumBD01(sample_rate)¶
- sample_ratefloat
The number of samples per seconds
Sample here: DrumBD01.ogg
Hat¶
Simulates a Hat hit, based on a Csound Hat instrument by Steven Cook.
- Nsound.Hat(sample_rate)¶
- sample_ratefloat
The number of samples per seconds
Sample here: Hat.ogg
Pipe Organ¶
Based on a Csound Pipe Organ by Hons Mikelson.
- Nsound.OrganPipe(sample_rate)¶
- sample_ratefloat
The number of samples per seconds
Sample here: OrganPipe.ogg
Slide Flute¶
Based on a physical model written in Csound by Hans Mikelson which was originally based on Perry Cook’s physical model.
- Nsound.FluteSlide(sample_rate)¶
- sample_ratefloat
The number of samples per seconds
Sample here: FluteSlide.ogg