-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsynth.hh
More file actions
40 lines (34 loc) · 1.11 KB
/
Copy pathsynth.hh
File metadata and controls
40 lines (34 loc) · 1.11 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
/* Created 2026-04-17 */
#ifndef __ALGORITHMIC_MUSIC_SYNTH_HH__
#define __ALGORITHMIC_MUSIC_SYNTH_HH__
#include <utility>
#include <vector>
#include <functional>
#include <cstdint>
#include <string>
#include <memory>
#include "note.hh"
#include "wavegenerator.hh"
#include "instrument.hh"
#include "track.hh"
#include "error.hh"
namespace syn
{
struct Synth
{
std::uint32_t sampleRate = 0;
TimeSignature signature{};
std::vector<Track> tracks;
std::vector<std::unique_ptr<Instrument>> instruments; // one instrument per track
bool Init(std::uint32_t sampleRate,
TimeSignature signature,
const std::vector<Track>& tracks,
const std::vector<InstrumentType>& instruments);
bool CheckSelf() const;
std::vector<float> StepTrack(std::size_t trackNo, double delta);
std::vector<float> Step(double delta);
// if the track is finished, it'll output -INFINITY.
float StepTrackSample(std::size_t trackNo);
};
}
#endif // __ALGORITHMIC_MUSIC_SYNTH_HH__