Wavepacket synthesis, with two overlapping streams of wave packets. More...
#include <WavePacket.h>
Wavepacket synthesis, with two overlapping streams of wave packets.
Draws on Miller Puckette's Pure Data example, F14.wave.packet.pd. Each packet is an enveloped grain of a sin (or cos) wave. The frequency of the wave, the width of the envelopes and the rate of release of envelopes are the parameters which can be changed.
ALGORITHM | options are SINGLE or DOUBLE, for a single non-overlapping stream of packets or a double, overlapping stream. |
Definition at line 36 of file WavePacket.h.
Public Member Functions | |
WavePacket () | |
Constructor. | |
void | set (int fundamental, int bandwidth, int centrefreq) |
Set all the parameters for the synthesis. More... | |
void | setFundamental (int fundamental) |
Set the fundamental frequency. More... | |
void | setBandwidth (int bandwidth) |
Set the bandwidth. More... | |
void | setCentreFreq (int centrefreq) |
Set the centre frequency. More... | |
int | next () |
Calculate the next synthesised sample. More... | |
|
inline |
Calculate the next synthesised sample.
Definition at line 113 of file WavePacket.h.
|
inline |
Set all the parameters for the synthesis.
The function is designed so that usable ranges for parameters can come from analog inputs, ie. 0-1023.
fundamental | the rate at which packets are produced. |
bandwidth | the width of each packet. A lower value allows more of the centre frequency to be audible, a rounder sound. A higher value produces narrower packets, a more buzzing sound. |
centrefreq | the oscillation frequency within each packet. |
Definition at line 57 of file WavePacket.h.
|
inline |
Set the bandwidth.
The function is designed so that usable ranges for parameters can come from analog inputs, ie. 0-1023.
bandwidth | the width of each packet. A lower value allows more of the centre frequency to be audible, a rounder sound. A higher value produces narrower packets, a more buzzing sound. |
Definition at line 85 of file WavePacket.h.
|
inline |
Set the centre frequency.
The function is designed so that usable ranges for parameters can come from analog inputs, ie. 0-1023.
centrefreq | the oscillation frequency within each packet. |
Definition at line 100 of file WavePacket.h.
|
inline |
Set the fundamental frequency.
The function is designed so that usable ranges for parameters can come from analog inputs, ie. 0-1023.
fundamental | the rate at which packets are produced. |
Definition at line 70 of file WavePacket.h.