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

Method PlayNote

Source/SampleFinder.cpp:317–334  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

315}
316
317void SampleFinder::PlayNote(double time, int pitch, int velocity, int voiceIdx, ModulationParameters modulation)
318{
319 if (mSample)
320 {
321 mPlay = false;
322 if (pitch == 16)
323 {
324 mSample->Reset();
325 }
326 else if (pitch >= 0 && pitch < 16 && velocity > 0)
327 {
328 int slice = (pitch / 8) * 8 + 7 - (pitch % 8);
329 int barLength = (mClipEnd - mClipStart) / mNumBars;
330 int position = -mOffset * barLength + (barLength / 4) * slice + mClipStart;
331 mSample->Play(time, 1, position);
332 }
333 }
334}
335
336void SampleFinder::LoadLayout(const ofxJSONElement& moduleInfo)
337{

Callers

nothing calls this directly

Calls 2

ResetMethod · 0.45
PlayMethod · 0.45

Tested by

no test coverage detected