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

Method PlayNote

Source/BeatBloks.cpp:974–991  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

972}
973
974void BeatBloks::PlayNote(double time, int pitch, int velocity, int voiceIdx, ModulationParameters modulation)
975{
976 if (mSample)
977 {
978 mPlay = false;
979 if (pitch == 16)
980 {
981 mSample->Reset();
982 }
983 else if (pitch >= 0 && pitch < 16 && velocity > 0)
984 {
985 int slice = (pitch / 8) * 8 + 7 - (pitch % 8);
986 int barLength = (mClipEnd - mClipStart) / mNumBars;
987 int position = (barLength / 4) * slice + mClipStart;
988 mSample->Play(time, 1, position);
989 }
990 }
991}
992
993void BeatBloks::LoadLayout(const ofxJSONElement& moduleInfo)
994{

Callers

nothing calls this directly

Calls 2

ResetMethod · 0.45
PlayMethod · 0.45

Tested by

no test coverage detected