-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAudioGen.h
More file actions
59 lines (46 loc) · 1.29 KB
/
AudioGen.h
File metadata and controls
59 lines (46 loc) · 1.29 KB
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
//
// AudioGen.h
// SqueakEngine
//
// Created by Ethan Geller on 11/16/14.
// Copyright (c) 2014 Ethan Geller. All rights reserved.
//
#ifndef __SqueakEngine__AudioGen__
#define __SqueakEngine__AudioGen__
#include <stdio.h>
#include <vector>
#include <math.h>
using namespace std;
//Generic Unit Generator.
class AudioGen {
//instance variables here
//pan: 0.0 = left, 1.0 = right
float pan;
float* sound;
//volume: 0.0 = silence, 1.0 = max
float volume;
//sound properties
int size, srate, channels, playhead;
public:
AudioGen();
AudioGen(vector<AudioGen*>priorChain);
AudioGen(float panVal);
AudioGen(float panVal, float volumeVal);
AudioGen(vector<AudioGen*>priorChain, float panVal, float volumeVal);
virtual void setSound(float* s);
float* getSound();
void setChain(vector<AudioGen*>chain);
vector<AudioGen*> getChain();
void setPan(float val);
float getPan();
void setVolume(float val);
float getVolume();
virtual void setSize(int s);
virtual int getSize();
virtual bool synthesize2(float* input, float* output, int numframes);
void cleanup();
protected:
//non-recursive solution
vector<AudioGen*> sources;
};
#endif /* defined(__SqueakEngine__AudioGen__) */