Home   Information   Classes   Download   Usage   Mail List   Requirements   Links   Tutorial


Drummer Class Reference

#include <Drummer.h>

Inheritance diagram for Drummer:

Instrmnt Stk List of all members.

Detailed Description

STK drum sample player class.

This class implements a drum sampling synthesizer using WvIn objects and one-pole filters. The drum rawwave files are sampled at 22050 Hz, but will be appropriately interpolated for other sample rates. You can specify the maximum polyphony (maximum number of simultaneous voices) via a #define in the Drummer.h.

by Perry R. Cook and Gary P. Scavone, 1995 - 2004.

Definition at line 28 of file Drummer.h.

Public Member Functions

 Drummer ()
 Class constructor.

 ~Drummer ()
 Class destructor.

void noteOn (StkFloat instrument, StkFloat amplitude)
 Start a note with the given drum type and amplitude.

void noteOff (StkFloat amplitude)
 Stop a note with the given amplitude (speed of decay).

StkFloat tick ()
 Compute one output sample.

StkFloat * tick (StkFloat *vector, unsigned int vectorSize)
 Computer vectorSize outputs and return them in vector.

StkFramestick (StkFrames &frames, unsigned int channel=1)
 Fill a channel of the StkFrames object with computed outputs.


Constructor & Destructor Documentation

Drummer::Drummer  ) 
 

Class constructor.

An StkError will be thrown if the rawwave path is incorrectly set.


Member Function Documentation

void Drummer::noteOn StkFloat  instrument,
StkFloat  amplitude
[virtual]
 

Start a note with the given drum type and amplitude.

Use general MIDI drum instrument numbers, converted to frequency values as if MIDI note numbers, to select a particular instrument. An StkError will be thrown if the rawwave path is incorrectly set.

Implements Instrmnt.

StkFrames& Drummer::tick StkFrames frames,
unsigned int  channel = 1
[virtual]
 

Fill a channel of the StkFrames object with computed outputs.

The channel argument should be one or greater (the first channel is specified by 1). An StkError will be thrown if the channel argument is zero or it is greater than the number of channels in the StkFrames object.

Reimplemented from Instrmnt.


The documentation for this class was generated from the following file:
The Synthesis ToolKit in C++ (STK)
©1995-2004 Perry R. Cook and Gary P. Scavone. All Rights Reserved.