Home   Information   Classes   Download   Usage   Mail List   Requirements   Links   FAQ   Tutorial


stk::Shakers Class Reference

PhISEM and PhOLIES class. More...

#include <Shakers.h>

Inheritance diagram for stk::Shakers:
stk::Instrmnt stk::Stk

List of all members.

Public Member Functions

 Shakers (int type=0)
 Class constructor taking instrument type argument.
void noteOn (StkFloat instrument, StkFloat amplitude)
 Start a note with the given instrument and amplitude.
void noteOff (StkFloat amplitude)
 Stop a note with the given amplitude (speed of decay).
void controlChange (int number, StkFloat value)
 Perform the control change specified by number and value (0.0 - 128.0).
StkFloat tick (unsigned int channel=0)
 Compute and return one output sample.
StkFramestick (StkFrames &frames, unsigned int channel=0)
 Fill a channel of the StkFrames object with computed outputs.

Detailed Description

PhISEM and PhOLIES class.

PhISEM (Physically Informed Stochastic Event Modeling) is an algorithmic approach for simulating collisions of multiple independent sound producing objects. This class is a meta-model that can simulate a Maraca, Sekere, Cabasa, Bamboo Wind Chimes, Water Drops, Tambourine, Sleighbells, and a Guiro.

PhOLIES (Physically-Oriented Library of Imitated Environmental Sounds) is a similar approach for the synthesis of environmental sounds. This class implements simulations of breaking sticks, crunchy snow (or not), a wrench, sandpaper, and more.

Control Change Numbers:

by Perry R. Cook with updates by Gary Scavone, 1995-2012.


Member Function Documentation

void stk::Shakers::noteOn ( StkFloat  instrument,
StkFloat  amplitude 
) [virtual]

Start a note with the given instrument and amplitude.

Use the instrument numbers above, converted to frequency values as if MIDI note numbers, to select a particular instrument.

Implements stk::Instrmnt.

StkFrames & stk::Shakers::tick ( StkFrames frames,
unsigned int  channel = 0 
) [inline, virtual]

Fill a channel of the StkFrames object with computed outputs.

The channel argument must be less than the number of channels in the StkFrames argument (the first channel is specified by 0). However, range checking is only performed if _STK_DEBUG_ is defined during compilation, in which case an out-of-range value will trigger an StkError exception.

Implements stk::Instrmnt.

00304 {
00305   unsigned int nChannels = lastFrame_.channels();
00306 #if defined(_STK_DEBUG_)
00307   if ( channel > frames.channels() - nChannels ) {
00308     oStream_ << "Shakers::tick(): channel and StkFrames arguments are incompatible!";
00309     handleError( StkError::FUNCTION_ARGUMENT );
00310   }
00311 #endif
00312 
00313   StkFloat *samples = &frames[channel];
00314   unsigned int j, hop = frames.channels() - nChannels;
00315   if ( nChannels == 1 ) {
00316     for ( unsigned int i=0; i<frames.frames(); i++, samples += hop )
00317       *samples++ = tick();
00318   }
00319   else {
00320     for ( unsigned int i=0; i<frames.frames(); i++, samples += hop ) {
00321       *samples++ = tick();
00322       for ( j=1; j<nChannels; j++ )
00323         *samples++ = lastFrame_[j];
00324     }
00325   }
00326 
00327   return frames;
00328 }


The documentation for this class was generated from the following file:

The Synthesis ToolKit in C++ (STK)
©1995-2012 Perry R. Cook and Gary P. Scavone. All Rights Reserved.