MCPcopy Create free account
hub / github.com/TheWaveWarden/odin2 / treeValueChangedNonParamOsc

Method treeValueChangedNonParamOsc

Source/PluginProcessorValueChange.cpp:1536–1759  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1534}
1535
1536void OdinAudioProcessor::treeValueChangedNonParamOsc(ValueTree &tree, const Identifier &id) {
1537 float p_new_value = (float)tree[id];
1538#ifdef DEBUG_VARIABLES
1539 DBG("nonparam_osc: " + id.toString().toStdString() + ": " + std::to_string(p_new_value));
1540#endif
1541 if (id == m_osc1_analog_wave_identifier) {
1542 for (int voice = 0; voice < VOICES; ++voice) {
1543 m_voice[voice].analog_osc[0].selectWavetable((int)p_new_value);
1544 }
1545 } else if (id == m_osc2_analog_wave_identifier) {
1546 for (int voice = 0; voice < VOICES; ++voice) {
1547 m_voice[voice].analog_osc[1].selectWavetable((int)p_new_value);
1548 }
1549 } else if (id == m_osc3_analog_wave_identifier) {
1550 for (int voice = 0; voice < VOICES; ++voice) {
1551 m_voice[voice].analog_osc[2].selectWavetable((int)p_new_value);
1552 }
1553 } else if (id == m_osc1_type_identifier) {
1554 for (int voice = 0; voice < VOICES; ++voice) {
1555 m_voice[voice].killGlide(0);
1556 m_osc_type[0] = p_new_value;
1557 // set new sync master osc
1558 switch (m_osc_type[0]) {
1559 case OSC_TYPE_ANALOG:
1560 m_voice[voice].setOscSyncOscillator(&(m_voice[voice].analog_osc[0]));
1561 break;
1562 case OSC_TYPE_WAVETABLE:
1563 m_voice[voice].setOscSyncOscillator(&(m_voice[voice].wavetable_osc[0]));
1564 break;
1565 case OSC_TYPE_MULTI:
1566 m_voice[voice].setOscSyncOscillator(&(m_voice[voice].multi_osc[0]));
1567 break;
1568 case OSC_TYPE_VECTOR:
1569 m_voice[voice].setOscSyncOscillator(&(m_voice[voice].vector_osc[0]));
1570 break;
1571 case OSC_TYPE_CHIPTUNE:
1572 m_voice[voice].setOscSyncOscillator(&(m_voice[voice].chiptune_osc[0]));
1573 break;
1574 case OSC_TYPE_FM:
1575 m_voice[voice].setOscSyncOscillator(&(m_voice[voice].fm_osc[0]));
1576 break;
1577 case OSC_TYPE_PM:
1578 m_voice[voice].setOscSyncOscillator(&(m_voice[voice].pm_osc[0]));
1579 break;
1580 case OSC_TYPE_WAVEDRAW:
1581 m_voice[voice].setOscSyncOscillator(&(m_voice[voice].wavedraw_osc[0]));
1582 break;
1583 case OSC_TYPE_CHIPDRAW:
1584 m_voice[voice].setOscSyncOscillator(&(m_voice[voice].chipdraw_osc[0]));
1585 break;
1586 case OSC_TYPE_SPECDRAW:
1587 m_voice[voice].setOscSyncOscillator(&(m_voice[voice].specdraw_osc[0]));
1588 break;
1589 default:
1590 // default (= none or noise) set nullptr
1591 m_voice[voice].setOscSyncOscillator(nullptr);
1592 break;
1593 }

Callers

nothing calls this directly

Calls 9

setOscSyncOscillatorMethod · 0.80
selectWavetableMethod · 0.45
killGlideMethod · 0.45
setCarrierRatioMethod · 0.45
setModulatorRatioMethod · 0.45

Tested by

no test coverage detected