MCPcopy Create free account
hub / github.com/BespokeSynth/BespokeSynth / PlayNote

Method PlayNote

Source/Producer.cpp:413–430  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

411}
412
413void Producer::PlayNote(double time, int pitch, int velocity, int voiceIdx, ModulationParameters modulation)
414{
415 if (mSample)
416 {
417 mPlay = false;
418 if (pitch == 16)
419 {
420 mSample->Reset();
421 }
422 else if (pitch >= 0 && pitch < 16 && velocity > 0)
423 {
424 int slice = (pitch / 8) * 8 + 7 - (pitch % 8);
425 int barLength = (mClipEnd - mClipStart) / mNumBars;
426 int position = -mOffset * barLength + (barLength / 4) * slice + mClipStart;
427 mSample->Play(time, 1, position);
428 }
429 }
430}
431
432void Producer::LoadLayout(const ofxJSONElement& moduleInfo)
433{

Callers

nothing calls this directly

Calls 2

ResetMethod · 0.45
PlayMethod · 0.45

Tested by

no test coverage detected