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

Method Process

Source/INoteReceiver.cpp:38–65  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

36}
37
38void NoteInputBuffer::Process(double time)
39{
40 PROFILER(NoteInputBuffer);
41
42 //process note offs first
43 for (int i = 0; i < kBufferSize; ++i)
44 {
45 if (mBuffer[i].time != -1 && mBuffer[i].velocity == 0 &&
46 IsTimeWithinFrame(mBuffer[i].time))
47 {
48 NoteInputElement& element = mBuffer[i];
49 mReceiver->PlayNote(element.time, element.pitch, element.velocity, element.voiceIdx, element.modulation);
50 mBuffer[i].time = -1;
51 }
52 }
53
54 //now process note ons
55 for (int i = 0; i < kBufferSize; ++i)
56 {
57 if (mBuffer[i].time != -1 && mBuffer[i].velocity != 0 &&
58 IsTimeWithinFrame(mBuffer[i].time))
59 {
60 NoteInputElement& element = mBuffer[i];
61 mReceiver->PlayNote(element.time, element.pitch, element.velocity, element.voiceIdx, element.modulation);
62 mBuffer[i].time = -1;
63 }
64 }
65}
66
67void NoteInputBuffer::QueueNote(double time, int pitch, float velocity, int voiceIdx, ModulationParameters modulation)
68{

Callers

nothing calls this directly

Calls 1

PlayNoteMethod · 0.45

Tested by

no test coverage detected