| Mozzi version v1.1.0 sound synthesis library for Arduino |

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