Hi everyone!
I’m trying to create a sort of 3d audio reproduction system by convolving the dry sound with the BRIRs of a room. The patch I’m working on will be connected to a head-tracker so that I can change BRIR depending on the position of the listener.
To achieve this I tried to use bsaylor’s [partconv~] but unfortunately, when I set a new impulse response, I have a short dead time. To fix this I tried to cross fade the output of two [partconv~] but this messes up the binaural cues, it is not the right approach.
My idea is that of modifying the .c code of the external to get what I need. Usually, I work on Code::Blocks, MinGW compiler, Win10. I’ve already built some super simple externals, but this time I’m facing a problem that I’ve never encountered before: to perform the Fourier transform, partconv~.c uses the fftw3 library, and I couldn’t find a way to add it to the Linker Options.
From what I’ve understood online, fftw3 is a dynamic library, therefore there’s no .lib file. On Code::Blocks Settings -> Compiler -> Linker Settings -> Link libraries I cannot load a .dll dynamic library. I tried different solutions that I found online but none of those worked. I get “undefined reference to” errors when calling all the fftw3 functions.
Can any of you help me somehow? If you were able to write an external that referred to the fftw3 library, how was your setup?
Moreover, I saw that in the bsaylor’s library folder there are also files of the type .dsp, .dsw, .o. Once I modify the .c code, should I update those as well?
I hope that I stated my issue clearly, if now please ask me for further details. Thank you in advance for your time.
Gloria
This is the Makefile from my Deken pkg (with sources) for Windows-amd64:
bsaylor[v0.1.4](Windows-amd64-32)(Sources).dek    Uploaded by lucarda @ 2018-09-29 11:33:54
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ class.sources = aenv~.c partconv~.c pvoc~.c susloop~.c svf~.c zhzxh~.c
ldlibs = -lfftw3 -lfftw3f -lpthread
include pd-lib-builder/Makefile.pdlibbuilder
# # # # sources from https://packages.debian.org/source/stable/pd-bsaylor # # Source Package: pd-bsaylor (0.1-4) # # # patched from pd-bsaylor_0.1-4.debian.tar.xz # # MinGW needs this package: # mingw64/mingw-w64-x86_64-fftw ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
You have to install (from the msys2 shell) the fftw library (check which arch to install) with:
   pacman -Ss fftw
then to install do (to install the amd64 version):
   pacman -S mingw64/mingw-w64-x86_64-fftw
Then you can build directly from the MinGW64 shell (or MinGW32 shell if you build for i386) with:
   make
Or if you are using your makefile add the linker flags "-lfftw3 -lfftw3f -lpthread". (i can't remember how to do this with code::blocks but I'm sure you can).
PS: then you need to copy files "libfftw3-3.dll libfftw3f-3.dll" from somewhere in your compiler folder to the same folder as your externals.
Hope it helps.
:)
Mensaje telepatico asistido por maquinas.
On 4/7/2021 3:54 AM, Gloria Dal Santo wrote:
Hi everyone!
IÂ’m trying to create a sort of 3d audio reproduction system by convolving the dry sound with the BRIRs of a room.
The patch IÂ’m working on will be connected to a head-tracker so that I can change BRIR depending on the position of the listener.
To achieve this I tried to use bsaylor’s  [partconv~] but unfortunately, when I set a new impulse response, I have a short dead time. To fix this I tried to cross fade the output of two [partconv~] but this messes up the binaural cues, it is not the right approach.
My idea is that of modifying the .c code of the external to get what I need. Usually, I work on Code::Blocks, MinGW compiler, Win10. I’ve already built some super simple externals, but this time I’m facing a problem that I’ve never encountered before: to perform the Fourier transform, partconv~.c uses the fftw3 library, and  I couldn’t find a way to add it to the Linker Options.
From what I’ve understood online, fftw3 is a dynamic library, therefore there’s no .lib file. On Code::Blocks Settings -> Compiler -> Linker Settings -> Link libraries I cannot load a .dll dynamic library. I tried different solutions that I found online but none of those worked. I get “undefined reference to” errors when calling all the fftw3 functions.
Can any of you help me somehow? If you were able to write an external that referred to the fftw3 library, how was your setup?
Moreover, I saw that in the bsaylor’s  library folder there are also files of the type .dsp, .dsw, .o. Once I modify the .c code, should I update those as well?
I hope that I stated my issue clearly, if now please ask me for further details.
Thank you in advance for your time.
Gloria
Pd-dev mailing list Pd-dev@lists.iem.at https://lists.puredata.info/listinfo/pd-dev
Hi Gloria,
generally, it is very much recommended to use https://github.com/pure-data/pd-lib-builder for building Pd externals. As Lucas' example shows, pd-lib-builder is very easy to use (only three lines!) and it allows other people to build your external for all the major platforms (Windows [with MinGW], macOS, Linux) simply by typing "make" :-). Only use another build system if you really need to!
Christof
On 07.04.2021 09:44, Lucas Cordiviola wrote:
This is the Makefile from my Deken pkg (with sources) for Windows-amd64:
bsaylor[v0.1.4](Windows-amd64-32)(Sources).dek    Uploaded by lucarda @ 2018-09-29 11:33:54
class.sources = aenv~.c partconv~.c pvoc~.c susloop~.c svf~.c zhzxh~.c ldlibs = -lfftw3 -lfftw3f -lpthread include pd-lib-builder/Makefile.pdlibbuilder # # # # sources from https://packages.debian.org/source/stable/pd-bsaylor # # Source Package: pd-bsaylor (0.1-4) # # # patched from pd-bsaylor_0.1-4.debian.tar.xz # # MinGW needs this package: # mingw64/mingw-w64-x86_64-fftw
You have to install (from the msys2 shell) the fftw library (check which arch to install) with:
   pacman -Ss fftw
then to install do (to install the amd64 version):
   pacman -S mingw64/mingw-w64-x86_64-fftw
Then you can build directly from the MinGW64 shell (or MinGW32 shell if you build for i386) with:
   make
Or if you are using your makefile add the linker flags "-lfftw3 -lfftw3f -lpthread". (i can't remember how to do this with code::blocks but I'm sure you can).
PS: then you need to copy files "libfftw3-3.dll libfftw3f-3.dll" from somewhere in your compiler folder to the same folder as your externals.
Hope it helps.
:)
Mensaje telepatico asistido por maquinas.
On 4/7/2021 3:54 AM, Gloria Dal Santo wrote:
Hi everyone!
IÂ’m trying to create a sort of 3d audio reproduction system by convolving the dry sound with the BRIRs of a room.
The patch IÂ’m working on will be connected to a head-tracker so that I can change BRIR depending on the position of the listener.
To achieve this I tried to use bsaylor’s  [partconv~] but unfortunately, when I set a new impulse response, I have a short dead time. To fix this I tried to cross fade the output of two [partconv~] but this messes up the binaural cues, it is not the right approach.
My idea is that of modifying the .c code of the external to get what I need. Usually, I work on Code::Blocks, MinGW compiler, Win10. I’ve already built some super simple externals, but this time I’m facing a problem that I’ve never encountered before: to perform the Fourier transform, partconv~.c uses the fftw3 library, and  I couldn’t find a way to add it to the Linker Options.
From what I’ve understood online, fftw3 is a dynamic library, therefore there’s no .lib file. On Code::Blocks Settings -> Compiler -> Linker Settings -> Link libraries I cannot load a .dll dynamic library. I tried different solutions that I found online but none of those worked. I get “undefined reference to” errors when calling all the fftw3 functions.
Can any of you help me somehow? If you were able to write an external that referred to the fftw3 library, how was your setup?
Moreover, I saw that in the bsaylor’s  library folder there are also files of the type .dsp, .dsw, .o. Once I modify the .c code, should I update those as well?
I hope that I stated my issue clearly, if now please ask me for further details.
Thank you in advance for your time.
Gloria
Pd-dev mailing list Pd-dev@lists.iem.at https://lists.puredata.info/listinfo/pd-dev
Pd-dev mailing list Pd-dev@lists.iem.at https://lists.puredata.info/listinfo/pd-dev