feat: parse patch files from json

This commit is contained in:
2024-01-18 01:56:00 +07:00
parent f0e2d98c12
commit b996685fe6
13 changed files with 24893 additions and 7 deletions

View File

@@ -18,9 +18,10 @@ class Application {
void InitAudio();
void UpdateOnNoteInput();
void PlayBufferedAudio();
public:
Application(/* args */);
~Application();
void Run();
void ParsePatch(std::string file_path);
};

View File

@@ -29,6 +29,7 @@ class Oscillator {
~Oscillator();
OscillatorType GetType() { return m_osc; }
void SetType(OscillatorType osc);
void SetType(std::string const& osc_name);
float GetVolume() { return m_volume; }
void SetVolume(float volume) { m_volume = volume; }
float GetKey() { return m_key; }

View File

@@ -17,6 +17,7 @@ class Synth {
std::vector<IEffect*> m_effects;
std::vector<float> m_out_signal;
LFO* m_lfo;
float m_lfo_level;
void ZeroSignal();
void GetNote();
void TriggerNoteOnEffects();
@@ -36,5 +37,8 @@ class Synth {
const bool& GetIsNoteTriggered() { return is_note_triggered; }
ADSR* GetADSR() { return (ADSR*)m_effects[0]; }
Filter* GetFilter() { return (Filter*)m_effects[1]; }
LFO* GetLFO() { return m_lfo; }
const float& GetLFOLevel() { return m_lfo_level; }
void SetLFOLevel(float lvl) { assert(0.f >= lvl <= 1.f); m_lfo_level = lvl; }
void SetFilter(FilterType type);
};

View File

@@ -1,6 +1,6 @@
#pragma once
#include "OscillatorType.h"
#include "raygui.h"
#include "raysan/raygui.h"
#include <vector>
#include "Filter.h"

24765
inc/nlohmann/json.hpp Normal file

File diff suppressed because it is too large Load Diff