- Edited
Hi!
I'm trying to make Bela run a Pure Data patch that writes to a text file and calls the '/root/Bela/scripts/halt_board.sh' script. It's working but I get underrun and mode switch detections - so I quess it's not smooth. Should I worry about the underrun and MSW? Is there an easy way to fix it?
I've previously succeeded both shutting down the board and writing to a txt-file at cleanup with C++:
system("/root/Bela/scripts/halt_board.sh");
float gCount = 0;
void logCount(const char* filename, float data) {
std::ofstream outputFile(filename, std::ios::app);
if (outputFile.is_open()) {
outputFile << data << std::endl;
outputFile.close();
}
}
void cleanup(BelaContext *context, void *userData)
{
logCount("log.txt", gLogCount);
}