CSL
6.0
|
GrainCloud – routine for playing clouds under GUI control. This could be called a cloud or a stream. You could also add a few more variables to make more flexible clouds. More...
#include <Granulator.h>
Public Member Functions | |
GrainCloud () | |
simple constructor More... | |
~GrainCloud () | |
void | startThreads () |
method to start-up the create/reap threads More... | |
void | reset () |
reset all grains to silent More... | |
Public Attributes | |
float | mRateBase |
grain rate base More... | |
float | mRateRange |
rate random range More... | |
float | mOffsetBase |
starting index offset base More... | |
float | mOffsetRange |
offset range More... | |
float | mDensityBase |
grain density base More... | |
float | mDensityRange |
grain density range More... | |
float | mDurationBase |
grain duration base More... | |
float | mDurationRange |
grain duration range More... | |
float | mWidthBase |
stereo width More... | |
float | mWidthRange |
stereo width More... | |
float | mVolumeBase |
amplitude scale More... | |
float | mVolumeRange |
amplitude range More... | |
float | mEnvelopeBase |
envelope base: 0 = perc, 0.5 = triangle, 1 = reverse perc More... | |
float | mEnvelopeRange |
envelope range More... | |
float * | mSamples |
sample buffer pointer More... | |
unsigned | numSamples |
of samples in bufferMore... | |
bool | isPlaying |
whether I'm on or off More... | |
Grain * | mSilentGrains |
shared grain lists - ptr to the free pool (silent) More... | |
Grain * | mPlayingGrains |
ptr to the list of active grains More... | |
GrainulatorState | gState |
granulator state flag More... | |
long | gNow |
clock for accurate timing More... | |
float | sampsPerTick |
resolution of hi-res clock(s-rate / 1 billion) More... | |
Protected Attributes | |
CThread * | spawnerThread |
thread to create grains More... | |
CThread * | reaperThread |
thread to kill finished grains More... | |
bool | threadOn |
if the thread's running More... | |
GrainCloud – routine for playing clouds under GUI control. This could be called a cloud or a stream. You could also add a few more variables to make more flexible clouds.
Definition at line 47 of file Granulator.h.
GrainCloud::GrainCloud | ( | ) |
simple constructor
Definition at line 86 of file Granulator.cpp.
References gState, isPlaying, csl::kFree, csl::logMsg(), csl::CThread::MakeThread(), MAXGRAINS, mPlayingGrains, mSamples, mSilentGrains, csl::Grain::nextGrain, reaperThread, SAFE_MALLOC, spawnerThread, and threadOn.
GrainCloud::~GrainCloud | ( | ) |
Definition at line 114 of file Granulator.cpp.
References reaperThread, csl::sleepMsec(), spawnerThread, and csl::CThread::stopThread().
void GrainCloud::startThreads | ( | ) |
method to start-up the create/reap threads
Definition at line 221 of file Granulator.cpp.
References C_TIME, createGrains(), csl::CThread::createThread(), csl::CGestalt::frameRate(), gNow, isPlaying, csl::logMsg(), reaperThread, reapGrains(), sampsPerTick, csl::sleepMsec(), spawnerThread, and threadOn.
Referenced by testGrainCloud().
void GrainCloud::reset | ( | ) |
reset all grains to silent
Definition at line 237 of file Granulator.cpp.
References mPlayingGrains, mSilentGrains, and csl::Grain::nextGrain.
float csl::GrainCloud::mRateBase |
grain rate base
Definition at line 55 of file Granulator.h.
Referenced by createGrains(), and testGrainCloud().
float csl::GrainCloud::mRateRange |
rate random range
Definition at line 56 of file Granulator.h.
Referenced by createGrains(), and testGrainCloud().
float csl::GrainCloud::mOffsetBase |
starting index offset base
Definition at line 57 of file Granulator.h.
Referenced by createGrains(), and testGrainCloud().
float csl::GrainCloud::mOffsetRange |
offset range
Definition at line 58 of file Granulator.h.
Referenced by createGrains(), and testGrainCloud().
float csl::GrainCloud::mDensityBase |
grain density base
Definition at line 59 of file Granulator.h.
Referenced by createGrains(), and testGrainCloud().
float csl::GrainCloud::mDensityRange |
grain density range
Definition at line 60 of file Granulator.h.
Referenced by createGrains(), and testGrainCloud().
float csl::GrainCloud::mDurationBase |
grain duration base
Definition at line 61 of file Granulator.h.
Referenced by createGrains(), and testGrainCloud().
float csl::GrainCloud::mDurationRange |
grain duration range
Definition at line 62 of file Granulator.h.
Referenced by createGrains(), and testGrainCloud().
float csl::GrainCloud::mWidthBase |
stereo width
Definition at line 63 of file Granulator.h.
Referenced by createGrains(), and testGrainCloud().
float csl::GrainCloud::mWidthRange |
stereo width
Definition at line 64 of file Granulator.h.
Referenced by createGrains(), and testGrainCloud().
float csl::GrainCloud::mVolumeBase |
amplitude scale
Definition at line 65 of file Granulator.h.
Referenced by createGrains(), and testGrainCloud().
float csl::GrainCloud::mVolumeRange |
amplitude range
Definition at line 66 of file Granulator.h.
Referenced by createGrains(), and testGrainCloud().
float csl::GrainCloud::mEnvelopeBase |
envelope base: 0 = perc, 0.5 = triangle, 1 = reverse perc
Definition at line 67 of file Granulator.h.
Referenced by createGrains(), and testGrainCloud().
float csl::GrainCloud::mEnvelopeRange |
envelope range
Definition at line 68 of file Granulator.h.
Referenced by createGrains(), and testGrainCloud().
float* csl::GrainCloud::mSamples |
sample buffer pointer
Definition at line 70 of file Granulator.h.
Referenced by createGrains(), GrainCloud(), and testGrainCloud().
unsigned csl::GrainCloud::numSamples |
Definition at line 71 of file Granulator.h.
Referenced by createGrains(), and testGrainCloud().
bool csl::GrainCloud::isPlaying |
whether I'm on or off
Definition at line 72 of file Granulator.h.
Referenced by createGrains(), GrainCloud(), reapGrains(), startThreads(), testGrainCloud(), and csl::GrainPlayer::~GrainPlayer().
Grain* csl::GrainCloud::mSilentGrains |
shared grain lists - ptr to the free pool (silent)
Definition at line 74 of file Granulator.h.
Referenced by createGrains(), GrainCloud(), reapGrains(), and reset().
Grain* csl::GrainCloud::mPlayingGrains |
ptr to the list of active grains
Definition at line 75 of file Granulator.h.
Referenced by createGrains(), GrainCloud(), reapGrains(), and reset().
GrainulatorState csl::GrainCloud::gState |
granulator state flag
Definition at line 76 of file Granulator.h.
Referenced by createGrains(), GrainCloud(), and reapGrains().
long csl::GrainCloud::gNow |
clock for accurate timing
Definition at line 77 of file Granulator.h.
Referenced by createGrains(), and startThreads().
float csl::GrainCloud::sampsPerTick |
resolution of hi-res clock(s-rate / 1 billion)
Definition at line 78 of file Granulator.h.
Referenced by createGrains(), and startThreads().
|
protected |
thread to create grains
Definition at line 81 of file Granulator.h.
Referenced by GrainCloud(), startThreads(), and ~GrainCloud().
|
protected |
thread to kill finished grains
Definition at line 82 of file Granulator.h.
Referenced by GrainCloud(), startThreads(), and ~GrainCloud().
|
protected |
if the thread's running
Definition at line 83 of file Granulator.h.
Referenced by GrainCloud(), and startThreads().