MCPcopy Create free account
hub / github.com/LMMS/lmms / updateModulators

Method updateModulators

plugins/monstro/Monstro.cpp:651–817  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

649
650
651inline void MonstroSynth::updateModulators( float * env1, float * env2, float * lfo1, float * lfo2, int frames )
652{
653 // frames played before
654 const f_cnt_t tfp = m_nph->totalFramesPlayed();
655
656 float * lfo [2];
657 float * env [2];
658 lfo[0] = lfo1;
659 lfo[1] = lfo2;
660 env[0] = env1;
661 env[1] = env2;
662
663 for( int i = 0; i < 2; ++i )
664 {
665 switch( m_lfovalue[i] )
666 {
667 case WAVE_SINE:
668 for( f_cnt_t f = 0; f < frames; ++f )
669 {
670 lfo[i][f] = Oscillator::sinSample( m_lfo_phase[i] );
671 m_lfo_phase[i] += m_lfo_inc[i];
672 }
673 break;
674 case WAVE_TRI:
675 for( f_cnt_t f = 0; f < frames; ++f )
676 {
677 lfo[i][f] = Oscillator::triangleSample( m_lfo_phase[i] );
678 m_lfo_phase[i] += m_lfo_inc[i];
679 }
680 break;
681 case WAVE_SAW:
682 for( f_cnt_t f = 0; f < frames; ++f )
683 {
684 lfo[i][f] = Oscillator::sawSample( m_lfo_phase[i] );
685 m_lfo_phase[i] += m_lfo_inc[i];
686 }
687 break;
688 case WAVE_RAMP:
689 for( f_cnt_t f = 0; f < frames; ++f )
690 {
691 lfo[i][f] = Oscillator::sawSample( m_lfo_phase[i] ) * -1.0f;
692 m_lfo_phase[i] += m_lfo_inc[i];
693 }
694 break;
695 case WAVE_SQR:
696 for( f_cnt_t f = 0; f < frames; ++f )
697 {
698 lfo[i][f] = Oscillator::squareSample( m_lfo_phase[i] );
699 m_lfo_phase[i] += m_lfo_inc[i];
700 }
701 break;
702 case WAVE_SQRSOFT:
703 for( f_cnt_t f = 0; f < frames; ++f )
704 {
705 lfo[i][f] = oscillate( WAVE_SQRSOFT, m_lfo_phase[i], 0 );
706 m_lfo_phase[i] += m_lfo_inc[i];
707 }
708 break;

Callers

nothing calls this directly

Calls 10

sinSampleFunction · 0.85
triangleSampleFunction · 0.85
sawSampleFunction · 0.85
squareSampleFunction · 0.85
oscillateFunction · 0.85
moogSawSampleFunction · 0.85
expSampleFunction · 0.85
noiseSampleFunction · 0.85
cosinusInterpolateFunction · 0.85
fractionFunction · 0.85

Tested by

no test coverage detected