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

Method Process

Source/Lissajous.cpp:48–78  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

46}
47
48void Lissajous::Process(double time)
49{
50 PROFILER(Lissajous);
51
52 SyncBuffers();
53
54 int bufferSize = GetBuffer()->BufferSize();
55 IAudioReceiver* target = GetTarget();
56 if (target)
57 {
58 for (int ch = 0; ch < GetBuffer()->NumActiveChannels(); ++ch)
59 {
60 Add(target->GetBuffer()->GetChannel(ch), GetBuffer()->GetChannel(ch), bufferSize);
61 GetVizBuffer()->WriteChunk(GetBuffer()->GetChannel(ch), GetBuffer()->BufferSize(), ch);
62 }
63 }
64
65 if (mEnabled)
66 {
67 mOnlyHasOneChannel = (GetBuffer()->NumActiveChannels() == 1);
68 int secondChannel = mOnlyHasOneChannel ? 0 : 1;
69
70 for (int i = 0; i < bufferSize; ++i)
71 mLissajousPoints[(mOffset + i) % NUM_LISSAJOUS_POINTS].set(GetBuffer()->GetChannel(0)[i], GetBuffer()->GetChannel(secondChannel)[i]);
72
73 mOffset += bufferSize;
74 mOffset %= NUM_LISSAJOUS_POINTS;
75 }
76
77 GetBuffer()->Reset();
78}
79
80void Lissajous::DrawModule()
81{

Callers

nothing calls this directly

Calls 8

AddFunction · 0.85
BufferSizeMethod · 0.80
NumActiveChannelsMethod · 0.80
GetChannelMethod · 0.80
GetBufferMethod · 0.80
WriteChunkMethod · 0.80
setMethod · 0.45
ResetMethod · 0.45

Tested by

no test coverage detected