feat: parse patch files from json
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user