fix(vm/compiler)!: don't define SU_BUFFER_LENGTH when speed is used

BREAKING CHANGE: If song uses a speed unit, SU_LENGTH_IN_SAMPLES,
SU_BUFFER_LENGTH and SU_SYNCBUFFER_LENGTH won't be defined in the
generated header file, as we cannot know their exact values during
compile time without rendering the entire song. When using a speed
unit, the user has to take responsibility of allocating large enough
buffers.

Closes #241
This commit is contained in:
2026-08-15 13:49:40 +03:00
parent f3a8377c56
commit 06b1c86c3a
5 changed files with 43 additions and 9 deletions
+6
View File
@@ -14,6 +14,12 @@
#include <stdio.h>
#include TEST_HEADER
#ifndef SU_BUFFER_LENGTH
// SU_BUFFER_LENGTH is not defined, likely because user is using the speed unit.
// But we will make the tests so that they don't use any more than this, so the
// usual size is fine.
#define SU_BUFFER_LENGTH SU_SAMPLES_PER_ROW*SU_LENGTH_IN_ROWS*SU_CHANNEL_COUNT
#endif
SUsample buf[SU_BUFFER_LENGTH];
SUsample filebuf[SU_BUFFER_LENGTH];
#ifdef SU_SYNC