-
Notifications
You must be signed in to change notification settings - Fork 0
class_sampleplayer
#####Inherits: Node
Sample Player node.
- void
set_sample_library( SampleLibrary library ) -
SampleLibrary
get_sample_library( ) const - void
set_voice_count( int max_voices ) -
int
get_voice_count( ) const -
int
play( String name, bool unique=false ) - void
stop( int voice ) - void
stop_all( ) - void
set_mix_rate( int voice, int hz ) - void
set_pitch_scale( int voice, real ratio ) - void
set_volume( int voice, real nrg ) - void
set_volume_db( int voice, real nrg ) - void
set_pan( int voice, real pan, real depth=0, real height=0 ) - void
set_filter( int voice, int type, real cutoff_hz, real resonance, real gain=0 ) - void
set_chorus( int voice, real send ) - void
set_reverb( int voice, int room_type, real send ) -
int
get_mix_rate( int voice ) const -
real
get_pitch_scale( int voice ) const -
real
get_volume( int voice ) const -
real
get_volume_db( int voice ) const -
real
get_pan( int voice ) const -
real
get_pan_depth( int voice ) const -
real
get_pan_height( int voice ) const -
int
get_filter_type( int voice ) const -
real
get_filter_cutoff( int voice ) const -
real
get_filter_resonance( int voice ) const -
real
get_filter_gain( int voice ) const -
real
get_chorus( int voice ) const -
real
get_reverb_room( int voice ) const -
real
get_reverb( int voice ) const - void
set_default_pitch_scale( real ratio ) - void
set_default_volume( real nrg ) - void
set_default_volume_db( real db ) - void
set_default_pan( real pan, real depth=0, real height=0 ) - void
set_default_filter( int type, real cutoff_hz, real resonance, real gain=0 ) - void
set_default_chorus( real send ) - void
set_default_reverb( int room_type, real send ) -
real
get_default_pitch_scale( ) const -
real
get_default_volume( ) const -
real
get_default_volume_db( ) const -
real
get_default_pan( ) const -
real
get_default_pan_depth( ) const -
real
get_default_pan_height( ) const -
int
get_default_filter_type( ) const -
real
get_default_filter_cutoff( ) const -
real
get_default_filter_resonance( ) const -
real
get_default_filter_gain( ) const -
real
get_default_chorus( ) const -
real
get_default_reverb_room( ) const -
real
get_default_reverb( ) const -
bool
is_active( ) const -
bool
is_voice_active( int voice ) const
- FILTER_NONE = 0 - Filter is disabled for voice.
- FILTER_LOWPASS = 1 - Lowpass filter is used for voice.
- FILTER_BANDPASS = 2 - Bandpass filter is used for voice.
- FILTER_HIPASS = 3 - HighPass filter is used for voice.
- FILTER_NOTCH = 4 - Notch filter is used for voice.
- FILTER_PEAK = 5
- FILTER_BANDLIMIT = 6 - Band-Limit filter is used for voice, in this case resonance is the highpass cutoff.
- FILTER_LOW_SHELF = 7
- FILTER_HIGH_SHELF = 8
- REVERB_SMALL = 0 - Small reverb room (house room).
- REVERB_MEDIUM = 1 - Medium reverb room (street)
- REVERB_LARGE = 2 - Large reverb room (Theather)
- REVERB_HALL = 3 - Huge reverb room (cathedral, warehouse).
SamplePlayer is a node meant for simple sample playback. A library of samples is loaded and played back "as is", without positioning or anything.
- void
set_voice_count( int max_voices )
Set the amount of simultaneous voices that will be used for playback.
-
int
get_voice_count( ) const
Return the amount of simultaneous voices that will be used for playback.
Play back sample, given it"apos;s identifier "name". if "unique" is true, all othere previous samples will be stopped. The voice allocated for playback will be returned.
- void
stop( int voice )
Stop a voice "voice". (see #play).
Change the mix rate of a voice "voice" to given "hz".
Scale the pitch (mix rate) of a voice by a ratio value "ratio". A ratio of 1.0 means the voice is unscaled.
Set the volume of a voice, 0db is maximum volume (every about -6db, volume is reduced in half). "db" does in fact go from zero to negative.
Set the panning of a voice. Panning goes from -1 (left) to +1 (right). Optionally, if the hardware supports 3D sound, also set depth and height (also in range -1 to +1).
Set and enable a filter of a voice, with type "type" (see FILTER_* enum), cutoff (0 to 22khz) frequency and resonance (0+).
Set the chorus send level of a voice (0 to 1). For setting chorus parameters, see audioserver.
Set the reverb send level and type of a voice (0 to 1). (see REVERB_* enum for type).
Return the current mix rate for a given voice.
Return the current pitch scale for a given voice.
Return the current volume (in db) for a given voice. 0db is maximum volume (every about -6db, volume is reduced in half). "db" does in fact go from zero to negative.
Return the current panning for a given voice. Panning goes from -1 (left) to +1 (right).
Return the current pan depth for a given voice (not used unless the hardware supports 3D sound)
Return the current pan height for a given voice (not used unless the hardware supports 3D sound)
Return the current filter type in use (see FILTER_* enum) for a given voice.
Return the current filter cutoff for a given voice. Cutoff goes from 0 to 22khz.
Return the current filter resonance for a given voice. Resonance goes from 0 up.
Return the current chorus send level for a given voice. (0 to 1).
Return the current reverb room type for a given voice (see REVERB_* enum).
Return the current reverb send level for a given voice. (0 to 1).