Bela
Real-time, ultra-low-latency audio and sensor processing system for BeagleBone Black
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups
drums.h
1 /*
2  * assignment2_drums
3  * ECS7012 Music and Audio Programming
4  *
5  * Second assignment, to create a sequencer-based
6  * drum machine which plays sampled drum sounds in loops.
7  *
8  * This code runs on the Bela embedded audio platform (bela.io).
9  *
10  * Andrew McPherson, Becky Stewart and Victor Zappi
11  * 2015-2020
12  */
13 
14 
15 #ifndef _DRUMS_H
16 #define _DRUMS_H
17 
18 #define NUMBER_OF_DRUMS 8
19 #define PATTERN_LENGTH 8
20 #define NUMBER_OF_READPOINTERS 16
21 
22 /* Start playing a particular drum sound */
23 void startPlayingDrum(int drumIndex);
24 
25 /* Start playing the next event in the pattern */
26 void startNextBeat();
27 
28 int eventContainsDrum(int event, int drum);
29 
30 void cleanupDrums();
31 
32 int initDrums();
33 
34 void updatePattern();
35 
36 
37 
38 #endif /* _DRUMS_H */