Panda3D
Loading...
Searching...
No Matches
filterProperties.I
Go to the documentation of this file.
1/**
2 * PANDA 3D SOFTWARE
3 * Copyright (c) Carnegie Mellon University. All rights reserved.
4 *
5 * All use of this software is subject to the terms of the revised BSD
6 * license. You should have received a copy of this license along
7 * with this source code in a file named "LICENSE."
8 *
9 * @file filterProperties.I
10 * @author jyelon
11 * @date 2007-08-01
12 */
13
14/**
15 * Removes all DSP postprocessing.
16 */
18clear() {
19 _config.clear();
20}
21
22/**
23 * Add a lowpass filter to the end of the DSP chain.
24 */
26add_lowpass(PN_stdfloat cutoff_freq, PN_stdfloat resonance_q) {
27 add_filter(FT_lowpass, cutoff_freq, resonance_q);
28}
29
30/**
31 * Add a highpass filter to the end of the DSP chain.
32 */
34add_highpass(PN_stdfloat cutoff_freq, PN_stdfloat resonance_q) {
35 add_filter(FT_highpass, cutoff_freq, resonance_q);
36}
37
38/**
39 * Add a echo filter to the end of the DSP chain.
40 */
42add_echo(PN_stdfloat drymix, PN_stdfloat wetmix, PN_stdfloat delay, PN_stdfloat decayratio) {
43 add_filter(FT_echo, drymix, wetmix, delay, decayratio);
44}
45
46/**
47 * Add a flange filter to the end of the DSP chain.
48 */
50add_flange(PN_stdfloat drymix, PN_stdfloat wetmix, PN_stdfloat depth, PN_stdfloat rate) {
51 add_filter(FT_flange, drymix, wetmix, depth, rate);
52}
53
54/**
55 * Add a distort filter to the end of the DSP chain.
56 */
58add_distort(PN_stdfloat level) {
59 add_filter(FT_distort, level);
60}
61
62/**
63 * Add a normalize filter to the end of the DSP chain.
64 */
66add_normalize(PN_stdfloat fadetime, PN_stdfloat threshold, PN_stdfloat maxamp) {
67 add_filter(FT_normalize, fadetime, threshold, maxamp);
68}
69
70/**
71 * Add a parameq filter to the end of the DSP chain.
72 */
74add_parameq(PN_stdfloat center_freq, PN_stdfloat bandwidth, PN_stdfloat gain) {
75 add_filter(FT_parameq, center_freq, bandwidth, gain);
76}
77
78/**
79 * Add a pitchshift filter to the end of the DSP chain.
80 */
82add_pitchshift(PN_stdfloat pitch, PN_stdfloat fftsize, PN_stdfloat overlap) {
83 add_filter(FT_pitchshift, pitch, fftsize, overlap);
84}
85
86/**
87 * Add a chorus filter to the end of the DSP chain.
88 */
90add_chorus(PN_stdfloat drymix, PN_stdfloat wet1, PN_stdfloat wet2, PN_stdfloat wet3, PN_stdfloat delay, PN_stdfloat rate, PN_stdfloat depth) {
91 add_filter(FT_chorus, drymix, wet1, wet2, wet3, delay, rate, depth);
92}
93
94/**
95 * Add a reverb filter to the end of the DSP chain.
96 */
98add_sfxreverb(PN_stdfloat drylevel, PN_stdfloat room, PN_stdfloat roomhf, PN_stdfloat decaytime,
99 PN_stdfloat decayhfratio, PN_stdfloat reflectionslevel, PN_stdfloat reflectionsdelay,
100 PN_stdfloat reverblevel, PN_stdfloat reverbdelay, PN_stdfloat diffusion,
101 PN_stdfloat density, PN_stdfloat hfreference, PN_stdfloat roomlf, PN_stdfloat lfreference) {
102 add_filter(FT_sfxreverb, drylevel, room, roomhf, decaytime, decayhfratio, reflectionslevel, reflectionsdelay,
103 reverblevel, reverbdelay, diffusion, density, hfreference, roomlf, lfreference);
104}
105
106/**
107 * Add a compress filter to the end of the DSP chain.
108 */
110add_compress(PN_stdfloat threshold, PN_stdfloat attack, PN_stdfloat release, PN_stdfloat gainmakeup) {
111 add_filter(FT_compress, threshold, attack, release, gainmakeup);
112}
113
114/**
115 * Intended for use by AudioManager and AudioSound implementations: allows
116 * access to the config vector.
117 */
119get_config() {
120 return _config;
121}
void add_lowpass(PN_stdfloat cutoff_freq, PN_stdfloat resonance_q)
Add a lowpass filter to the end of the DSP chain.
void add_distort(PN_stdfloat level)
Add a distort filter to the end of the DSP chain.
void add_normalize(PN_stdfloat fadetime, PN_stdfloat threshold, PN_stdfloat maxamp)
Add a normalize filter to the end of the DSP chain.
void add_highpass(PN_stdfloat cutoff_freq, PN_stdfloat resonance_q)
Add a highpass filter to the end of the DSP chain.
void add_compress(PN_stdfloat threshold, PN_stdfloat attack, PN_stdfloat release, PN_stdfloat gainmakeup)
Add a compress filter to the end of the DSP chain.
void add_echo(PN_stdfloat drymix, PN_stdfloat wetmix, PN_stdfloat delay, PN_stdfloat decayratio)
Add a echo filter to the end of the DSP chain.
void clear()
Removes all DSP postprocessing.
void add_flange(PN_stdfloat drymix, PN_stdfloat wetmix, PN_stdfloat depth, PN_stdfloat rate)
Add a flange filter to the end of the DSP chain.
const ConfigVector & get_config()
Intended for use by AudioManager and AudioSound implementations: allows access to the config vector.
void add_sfxreverb(PN_stdfloat drylevel=0, PN_stdfloat room=-10000, PN_stdfloat roomhf=0, PN_stdfloat decaytime=1, PN_stdfloat decayhfratio=0.5, PN_stdfloat reflectionslevel=-10000, PN_stdfloat reflectionsdelay=0.02, PN_stdfloat reverblevel=0, PN_stdfloat reverbdelay=0.04, PN_stdfloat diffusion=100, PN_stdfloat density=100, PN_stdfloat hfreference=5000, PN_stdfloat roomlf=0, PN_stdfloat lfreference=250)
Add a reverb filter to the end of the DSP chain.
void add_pitchshift(PN_stdfloat pitch, PN_stdfloat fftsize, PN_stdfloat overlap)
Add a pitchshift filter to the end of the DSP chain.
void add_chorus(PN_stdfloat drymix, PN_stdfloat wet1, PN_stdfloat wet2, PN_stdfloat wet3, PN_stdfloat delay, PN_stdfloat rate, PN_stdfloat depth)
Add a chorus filter to the end of the DSP chain.
void add_parameq(PN_stdfloat center_freq, PN_stdfloat bandwidth, PN_stdfloat gain)
Add a parameq filter to the end of the DSP chain.