forked from sensorium/Mozzi
-
Notifications
You must be signed in to change notification settings - Fork 1
/
WavePacketSample.h
executable file
·42 lines (35 loc) · 1.08 KB
/
WavePacketSample.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
/*
* WavePacketSample.h
*
* Copyright 2013 Tim Barrass.
*
* This file is part of Mozzi.
*
* Mozzi is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.
*
*/
#ifndef WAVEPACKETSAMPLE_H
#define WAVEPACKETSAMPLE_H
#include "WavePacket.h"
/** A WavePacket which allows a custom table to be set as the audio source for the wavepackets (or grains).
@tparam ALGORITHM options are SINGLE or DOUBLE, for a single non-overlapping stream of packets or a double, overlapping stream.
*/
template <int8_t ALGORITHM>
class WavePacketSample: public WavePacket<ALGORITHM>
{
public:
/** Change the sound table which will be played. Needs to be 8192 cells long for now.
@param TABLE_NAME is the name of the array in the table ".h" file you're using.
*/
inline
void setTable(const int8_t * TABLE_NAME)
{
aWav.setTable(TABLE_NAME);
}
private:
Oscil <8192, AUDIO_RATE> aWav;
};
/** @example 06.Synthesis/WavePacket_Sample/WavePacket_Sample.ino
This is an example of how to use the WavePacketSample class.
*/
#endif // #ifndef WAVEPACKETSAMPLE_H