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

Method playNote

plugins/bit_invader/bit_invader.cpp:262–302  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

260
261
262void bitInvader::playNote( NotePlayHandle * _n,
263 sampleFrame * _working_buffer )
264{
265 if ( _n->totalFramesPlayed() == 0 || _n->m_pluginData == NULL )
266 {
267
268 float factor;
269 if( !m_normalize.value() )
270 {
271 factor = 1.0f;
272 }
273 else
274 {
275 factor = m_normalizeFactor;
276 }
277
278 _n->m_pluginData = new bSynth(
279 const_cast<float*>( m_graph.samples() ),
280 m_graph.length(),
281 _n,
282 m_interpolation.value(), factor,
283 Engine::mixer()->processingSampleRate() );
284 }
285
286 const fpp_t frames = _n->framesLeftForCurrentPeriod();
287 const f_cnt_t offset = _n->noteOffset();
288
289 bSynth * ps = static_cast<bSynth *>( _n->m_pluginData );
290 for( fpp_t frame = offset; frame < frames + offset; ++frame )
291 {
292 const sample_t cur = ps->nextStringSample();
293 for( ch_cnt_t chnl = 0; chnl < DEFAULT_CHANNELS; ++chnl )
294 {
295 _working_buffer[frame][chnl] = cur;
296 }
297 }
298
299 applyRelease( _working_buffer, _n );
300
301 instrumentTrack()->processAudioBuffer( _working_buffer, frames + offset, _n );
302}
303
304
305

Callers

nothing calls this directly

Calls 8

mixerFunction · 0.85
processingSampleRateMethod · 0.80
nextStringSampleMethod · 0.80
instrumentTrackFunction · 0.50
valueMethod · 0.45
lengthMethod · 0.45
processAudioBufferMethod · 0.45

Tested by

no test coverage detected