Skip to content

Commit

Permalink
put at end of process(); send loadbang for first iteration
Browse files Browse the repository at this point in the history
  • Loading branch information
dromer committed Sep 6, 2023
1 parent 5b80dbb commit f35cb62
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
4 changes: 2 additions & 2 deletions hvcc/generators/ir2c/templates/Heavy_NAME.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -161,8 +161,6 @@ void Heavy_{{name}}::{{x}}
*/

int Heavy_{{name}}::process(float **inputBuffers, float **outputBuffers, int n) {
sendBangToReceiver(0xDD21C0EB); // send to __hv_bang~

while (hLp_hasData(&inQueue)) {
hv_uint32_t numBytes = 0;
ReceiverMessagePair *p = reinterpret_cast<ReceiverMessagePair *>(hLp_getReadBuffer(&inQueue, &numBytes));
Expand Down Expand Up @@ -248,6 +246,8 @@ int Heavy_{{name}}::process(float **inputBuffers, float **outputBuffers, int n)
blockStartTimestamp = nextBlock;
return n;
{%- endif %}

sendBangToReceiver(0xDD21C0EB); // send to __hv_bang~
}

int Heavy_{{name}}::processInline(float *inputBuffers, float *outputBuffers, int n4) {
Expand Down
9 changes: 6 additions & 3 deletions hvcc/interpreters/pd2hv/libs/pd/bang~.pd
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
#N canvas 502 0 450 300 12;
#X obj 99 115 r __hv_bang~;
#X obj 99 140 outlet;
#N canvas 502 0 549 254 12;
#X obj 99 102 r __hv_bang~;
#X obj 99 173 outlet;
#X obj 99 71 inlet;
#X text 151 69 inlet is inactive;
#X obj 128 132 r __hv_loadbang;
#X text 255 111 because we only receive the first bang at the end of the first process() loop we first send a loadbang;
#X connect 0 0 1 0;
#X connect 4 0 1 0;

0 comments on commit f35cb62

Please sign in to comment.