#include <Snd.h>
Public Slots | |
void | orchUpdate (double val) |
void | go () |
void | stop () |
Public Member Functions | |
Snd (int chans, int srate, int buffsize) | |
virtual | ~Snd () |
void | addInstrument (Jukebox *i) |
double * | tickFrame (double *in) |
double * | tickOrch (double *tmp) |
Public Attributes | |
int | _chans |
int | _srate |
int | _buffsize |
double * | out |
double * | in |
int | ctr |
int | tick_ctr |
QWaitCondition | nexttick |
bool | running |
double | bufTime |
double | timeInc |
QPtrList< Jukebox > | orch |
Definition at line 12 of file Snd.h.
|
Definition at line 14 of file Snd.cpp. References _buffsize, _chans, _srate, ctr, in, orch, out, running, tick_ctr, and timeInc. 00014 : 00015 _chans(chans), 00016 _srate(srate), 00017 _buffsize(buffsize) 00018 { 00019 orch.setAutoDelete (true); // will delete all instruments in orchestra list 00020 Stk::setSampleRate ((double) _srate); 00021 // Stk::setRawwavePath ("/home/cc/220a/system/stk-4.2.1/rawwaves/"); 00022 out = new double[_chans]; 00023 in = new double[_chans]; 00024 running = false; 00025 ctr = 0; 00026 timeInc = ((double) (_buffsize)) / Stk::sampleRate (); 00027 tick_ctr = 0; 00028 }
|
|
Definition at line 30 of file Snd.cpp.
|
|
Definition at line 112 of file Snd.cpp. References orch. Referenced by MainDialog::MainDialog().
|
|
Definition at line 78 of file Snd.cpp. References bufTime, ctr, running, and tick_ctr.
|
|
Definition at line 121 of file Snd.cpp. References orch. 00123 { 00124 Jukebox *i = orch.first (); 00125 while (i) 00126 { 00127 // i->update (val); 00128 i = orch.next (); 00129 } 00130 }
|
|
Definition at line 87 of file Snd.cpp. References running. 00088 { 00089 running = false; 00090 }
|
|
Definition at line 38 of file Snd.cpp. References _buffsize, _chans, bufTime, ctr, GAIN, nexttick, out, running, tick_ctr, tickOrch(), and timeInc. Referenced by xx_global_process_xx(). 00040 { 00041 bool overflow = false; 00042 if (running) 00043 { 00044 /* ------ this is where the real work happens ------ */ 00045 ctr++; 00046 out = tickOrch (in); // process orchestra objects 00047 for (int ch = 0; ch < _chans; ch++) 00048 out[ch] *= GAIN; 00049 if ((fabs (out[0]) > 1.0) || (fabs (out[0]) > 1.0)) 00050 overflow = true; 00051 // out[0] = out[1] = sin(6.28*0.001*(double)ctr); 00052 } 00053 else // muted 00054 { 00055 for (int ch = 0; ch < _chans; ch++) 00056 out[ch] = 0.0; 00057 } 00058 if (running) 00059 { 00060 /* ------ wake any per buffer processes ------ */ 00061 tick_ctr++; 00062 if (tick_ctr == _buffsize) 00063 { 00064 bufTime += timeInc; 00065 nexttick.wakeAll (); 00066 tick_ctr = 0; 00067 } 00068 } 00069 if (overflow) 00070 { 00071 printf ("overflow\n"); 00072 } 00073 return out; 00074 }
Here is the call graph for this function: |
|
Definition at line 93 of file Snd.cpp. References _chans, Jukebox::getOut(), orch, and Jukebox::tick(). Referenced by tickFrame(). 00095 { 00096 for (int i = 0; i < _chans; i++) 00097 tmp[i] = 0.0; 00098 Jukebox *i = orch.first (); 00099 while (i) 00100 { 00101 // assign outputs by mod if more objects than channels 00102 i->tick(); 00103 for (int ch = 0; ch < _chans; ch++) 00104 tmp[ch] += i->getOut (ch); 00105 i = orch.next (); 00106 } 00107 tmp[1] = tmp[0]; 00108 return tmp; 00109 }
Here is the call graph for this function: |
|
Definition at line 18 of file Snd.h. Referenced by Snd(), and tickFrame(). |
|
Definition at line 16 of file Snd.h. Referenced by Snd(), tickFrame(), and tickOrch(). |
|
Definition at line 17 of file Snd.h. Referenced by Snd(). |
|
Definition at line 26 of file Snd.h. Referenced by go(), and tickFrame(). |
|
Definition at line 22 of file Snd.h. Referenced by go(), Snd(), and tickFrame(). |
|
|
|
Definition at line 24 of file Snd.h. Referenced by tickFrame(). |
|
Definition at line 29 of file Snd.h. Referenced by addInstrument(), orchUpdate(), Snd(), and tickOrch(). |
|
Definition at line 20 of file Snd.h. Referenced by Snd(), tickFrame(), and ~Snd(). |
|
Definition at line 25 of file Snd.h. Referenced by go(), Snd(), stop(), and tickFrame(). |
|
Definition at line 23 of file Snd.h. Referenced by go(), Snd(), and tickFrame(). |
|
Definition at line 27 of file Snd.h. Referenced by Snd(), and tickFrame(). |