jayrope Apparently using mv the_file loop_the_file created an extra ressource file under the old name it's project folder, which was confusing Bela.
how was it confusing it? Was it throwing an error of sorts? That file is actually always there, it is the binary that gets built and run, but it is normally hidden in the IDE. If you do "save as" from the IDE it will delete it for you.
jayrope As a good precaution for accidental firing in live use i would propose for the button to only fire "next patch", when it has been pressed for at least 1 second
good point. This requires another change in core/PRU.cpp
: find the lines
if(++stopButtonCount > 10){
printf("Button pressed, quitting\n");
Bela_requestStop();
}
just below your previous edit. You can then replace 10
with something like context->audioSampleRate / context->audioFrames * 1.0
, where 1.0
is the number of seconds you want to wait before the button stops the current patch.
and then additionally give the power down function a bigger delay of say 5 seconds
to do this you need an extra parameter to bela-cape-btn
in the bela_button.service
file: --hold-press-timeout-ms 5000
jayrope And question: IF the above would work could on reactivate the now redefined "next patch" to be used in PD or elsewhere for tap buttons, triggers and other short pressed uses (that possible at all?)?
I think it should work.
jayrope This could also be achieved for the button to only fire "next patch" OR "power down", when a second button is pressed at the same time, behaving like a shift button.
This is more complicated, I was thinking that maybe what I need to add is a way for the Pd user to stop the program by sending a Pd message. Then it is up to your Pd patch to handle the logic for triggering that message (this can coexist with the other methods). All that should be needed to achieve this is adding this patch to core/default_libpd_render.cpp
(untested):
diff --git a/core/default_libpd_render.cpp b/core/default_libpd_render.cpp
index bcec769c..443726cf 100644
--- a/core/default_libpd_render.cpp
+++ b/core/default_libpd_render.cpp
@@ -350,6 +350,11 @@ void Bela_listHook(const char *source, int argc, t_atom *argv)
#endif // BELA_LIBPD_GUI
}
void Bela_messageHook(const char *source, const char *symbol, int argc, t_atom *argv){
+ if(strcmp(source, "bela_stop") == 0)
+ {
+ Bela_requestStop();
+ return;
+ }
if(strcmp(source, "bela_setMidi") == 0)
{
if(0 == strcmp("verbose", symbol))