Just started looking into block sizes of Pure Data when running under the Bela, and I'm somewhat unclear in what to expect.
For instance, https://forum.bela.io/d/101-compiling-puredata-externals/47 notes (post is from this year, 2018, Mar):
the difference between platforms could be due to the fact that on Bela Pd's internal blocksize is 16, while in Pd it defaults to 64. Your code does an FFT of the size of the incoming buffer, so maybe mayer_reallfft() does not like an FFT of size 16?
Note that you cannot change this parameter at runtime: you would need to recompile libpd editing
#define DEFDACBLKSIZE 16
to
#define DEFDACBLKSIZE 64
in
libpd/pure-data/src/s_stuff.h
So, this tells me I cannot change the block size for PureData/libpd on Bela without recompiling.
On the other hand, there is https://github.com/BelaPlatform/Bela/wiki/Running-Puredata-patches-on-Bela :
Another thing that changed is the minimum block size, which is now 8 samples per block (vs the 64 of stock Pd/libpd). Actual block size can be adjusted at runtime using the -C command line parameter. Accepted values are 8, 16, 32, 64, 128, default is 16.
Ok, so this tells me I can change the libpd block size at runtime, with a -C
command line parameter.
Finally, I've opened one of my PD patches in the Bela IDE, and changed the Project Settings tab, and set:
- Block size (audio frames): 64
- Analog channels: 4
... and when I inspect the corresponding settings.json
file, I get:
root@bela:~/Bela/projects# cat TestPD/settings.json
{"fileName":"_main.pd","CLArgs":{"-p":"64","-C":"4","-B":"16","-H":"-6","-N":"1","-G":"1","-M":"0","-D":"0","-A":"0","--pga-gain-left":"10","--pga-gain-right":"10","user":"","make":"","-X":"0","audioExpander":"0","-Y":"","-Z":"","--disable-led":"0"}}
... which tells me that the -C
command line parameter is not for block size, but for analog channels instead - and the block size command line parameter is -p
?
So I have a hard time understanding how is it supposed to work: is it possible to change libpd block size at runtime, and if so, is the -C
or the -p
proper command line parameter to use?