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

@@ -43,6 +43,19 @@ void Oscillator::SetType(OscillatorType osc) {
}
}
void Oscillator::SetType(std::string const& osc_name) {
if (osc_name == "Sine")
m_osc = Sine;
else if (osc_name == "Triangle")
m_osc = Triangle;
else if (osc_name == "Saw")
m_osc = Saw;
else if (osc_name == "Square")
m_osc = Square;
SetType(m_osc);
}
void Oscillator::SetKey(float key) {
m_key = key;
float freq = KeyBoard::GetHzBySemitone(m_key + m_fine);