beat

Arrange audio samples into something bigger
git clone https://git.ce9e.org/beat.git

commit
2165140b0f79b9d2300f3f459833715daf13c960
parent
99463eb6bbeb26c8efb2cdd92be61cca3e854dc2
Author
Tobias Bengfort <tobias.bengfort@posteo.de>
Date
2019-12-18 13:20
create buffers on demand

Diffstat

M beat.c 7 +++++--

1 files changed, 5 insertions, 2 deletions


diff --git a/beat.c b/beat.c

@@ -48,6 +48,10 @@ void add_file_at_beat(const char *path, int beat) {
   48    48             rel_pos += 1;
   49    49             while (rel_pos >= BUFSIZE) {
   50    50                 rel_pos -= BUFSIZE;
   -1    51                 if (curctx->next == ctx) {
   -1    52                     curctx->next = create_context();
   -1    53                     curctx->next->next = ctx;
   -1    54                 }
   51    55                 curctx = curctx->next;
   52    56             }
   53    57             curctx->buf[rel_pos] += fbuf[i] * factor;
@@ -79,8 +83,7 @@ int main(int argc, char **argv) {
   79    83     buf_cur = 0;
   80    84 
   81    85     ctx = create_context();
   82    -1     ctx->next = create_context();
   83    -1     ctx->next->next = ctx;
   -1    86     ctx->next = ctx;
   84    87 
   85    88     SF_INFO sfinfo;
   86    89     sfinfo.channels = 1;