Camomile v1.0.1 - An audio plugin with Pure Data embedded
Thanks for the info @Pierre-Guillot!
@Pierre-Guillot said:
I argue that adding external is just a matter of incorporating them in libpd.dll. Am I right?
Yes but the libpd used by Camomile is the static library (.lib/.so/.a) that why libpd is embedded in Camomile.
- In fact, I guess that some of the external libraries are already compatible with multiinstance support because it depends on what parts of the Pd API the libraries use. But to ensure the multiinstance support you must use the C flags
-DPDINSTANCE=1
(and-DPDTHREAD=1
) while compiling the library or libpd and avoid all the static variables (except if they use thread local storage and you ensure to init them well on each thread). Here is one of the 1st posts by Miller about it: https://lists.puredata.info/pipermail/pd-dev/2017-04/020980.html
So i guess i have to remove directly from the external code all the static variable, so basically remove the "static" keyword from the variable declarations.
How can i compile libpd as a .lib/.so/.a and not .dll?
Should i use those flags in the various makefiles or just as a fleg in the command line? (assuming working with msys2 on Win64)
- The same way you did it for the "standard" approach.
So it's enough to use a x64 compiler and a x64 target?
- Including an external library with libpd is pretty straightforward (as long as, in this case, the library has the multiinstance support). See this: https://github.com/libpd/libpd/wiki/Adding-Pure-Data-external-libraries-to-your-project. And if a library is included in libpd it will also be included in Camomile.
So you also have to compile libpd then Camomile (all the instructions are on the Github repository - I updated it a week ago https://github.com/pierreguillot/Camomile/tree/dev/v1.0.6-lv2#compilation - or just do the same steps as on Travis and Appveyor and I can help if needed).
Cheers
I don't really know what Travis and Appeveyor are. I have to check them out.
How to include the static pthread lib for Win compilation? You mention it the Camomile build process readme.
PS: Another approach would have been to ship the libpd dynamic library next to each plugin. i need to try this but I afraid that, on Windows and Linux, the DAW think that the libpd library is another plugin try to load it.
I guess that most hosts have an avoid list for specific .dll. At least Reaper have a config file where is possible to remove a specific .dll from being scanned as a plugin.
thanks!
Camomile v1.0.1 - An audio plugin with Pure Data embedded
I argue that adding external is just a matter of incorporating them in libpd.dll. Am I right?
Yes but the libpd used by Camomile is the static library (.lib/.so/.a) that why libpd is embedded in Camomile.
-
In fact, I guess that some of the external libraries are already compatible with multiinstance support because it depends on what parts of the Pd API the libraries use. But to ensure the multiinstance support you must use the C flags
-DPDINSTANCE=1
(and-DPDTHREAD=1
) while compiling the library or libpd and avoid all the static variables (except if they use thread local storage and you ensure to init them well on each thread). Here is one of the 1st posts by Miller about it: https://lists.puredata.info/pipermail/pd-dev/2017-04/020980.html -
The same way you did it for the "standard" approach.
-
Including an external library with libpd is pretty straightforward (as long as, in this case, the library has the multiinstance support). See this: https://github.com/libpd/libpd/wiki/Adding-Pure-Data-external-libraries-to-your-project. And if a library is included in libpd it will also be included in Camomile.
So you also have to compile libpd then Camomile (all the instructions are on the Github repository - I updated it a week ago https://github.com/pierreguillot/Camomile/tree/dev/v1.0.6-lv2#compilation - or just do the same steps as on Travis and Appveyor and I can help if needed).
Cheers
PS: Another approach would have been to ship the libpd dynamic library next to each plugin. i need to try this but I afraid that, on Windows and Linux, the DAW think that the libpd library is another plugin try to load it.
pd-extended included externals on windows
@youaresound Hello.....
I played around a little....
Without your batch file pd.exe runs fine, but with no libraries and this error......
Giving the full path to Pd in the batch file solves this....... but that will not be practical.
The font you selected gives unpleasant rendering on my machine.... I removed it afterwards, but it does work so you can put it back in you wish.....
I then removed the (not useful) path setting.... (it is still shown here).
You will see that "Pd documents directory" is disabled...... probably due to the -noprefs switch.
I added (first switch) -lib libdir to the batch file and now most libraries are added (but none will create), even copying your upload to other folders. I cannot be absolutely certain that windows is not keeping tabs on the changing path though.
With -noprefs -lib ibdir my other installs and portable versions of Pd are not having their prefs and paths overwritten though.
That is very good news.
Here are the libs that are still not loading..... but that is as far as I have gone for now.
Here is the updated batch file that works for me........... (at the bottom)
BUT...... the full path to the library folders needs to be specified for any object to actually create.
Just adding the extra folder does not work.
So in the batch below only cyclone will actually work even though the other object classes have been registered.
You might have ideas about why the iem libraries will not load (I think the executable needs to be specified)..
You can maybe try this new batch file yourself...... and find another tester to double-check....
BUT ANOTHER BUT ...... the path setting will be wrong...... I will try to work out how to get around that. The tcl has path variables that can maybe be set with a tcl plugin.
It is probable that removing the -noprefs switch will solve these problems, but an existing Pd user running your batch file would curse you as they tried to recover their old working Pd........
David.
pd-0.48.1_windows_xp_or_later\bin\pd.exe -path C:\Users\David\Desktop\pd-vanilla_0.48.1_for-windows_with_externals\pd-windows\pd-0.48.1_windows_xp_or_later\extra\cyclone -noprefs -lib libdir -lib cyclone -lib zexy -lib creb -lib cxc -lib iemlib -lib list-abs -lib mapping -lib markex -lib maxlib -lib mjlib -lib motex -lib oscx -lib pddp -lib pdogg -lib pmpd -lib sigpack -lib smlib -lib unauthorized -lib pan -lib hcs -lib jmmmp -lib ext13 -lib ggee -lib iem_anything -lib ekext -lib flatgui -lib chaos -lib zexy/0x260x260x7e -lib zexy/0x2e -lib zexy/0x3c0x7e -lib zexy/0x3d0x3d0x7e -lib zexy/0x3e0x7e -lib zexy/0x7c0x7c0x7e
The ultimate solution is probably to destroy the directory tree...... moving every file into the Pd /bin folder.
TimbreID On Raspberry Pi
Compiling only TimbreId against pd (not compiling pd source).
To load timbreIDLib, list the path to the timbreIDLib library file in Pd's startup dialog (e.g., /home/yourname/pd_libs/timbreID/timbreIDLib).
timbreID version 0.7 requires the FFTW library, available at http://www.fftw.org.
FFTW is included pre-compiled with timbreID's Windows binary package available through deken. It's fine to simply leave libfftw3f-3.dll in the timbreID directory for use as a shared library. For Linux and Macintosh, FFTW is statically linked with the timbreIDLib library file, so there is no need for compiling or obtaining FFTW.
If you are compliling FFTW yourself, it must be compiled in single precision. To do so in Linux, configure FFTW like this:
./configure CFLAGS="-fPIC" --enable-float
and like this on a Macintosh:
./configure CFLAGS="-arch i386 -arch x86_64" --enable-float
Then run:
make
sudo make install
The FFTW library for Windows is available precompiled at:
http://www.fftw.org/install/windows.html
You will need the 32-bit version, and the single precision version specifically. The provided zip file contains several compiled versions of FFTW, but only libfftw3f-3.dll is required for timbreID version 0.7.
On Linux and Macintosh, the FFTW library files should be installed to /usr/local/lib by default. Once FFTW is properly built and installed, you can make timbreID using the included Makefile by running:
make
You must specify the location of your Pure Data source code directory in the Makefile beforehand. Compilation from source on Windows can be done with the same Makefile if you use MinGW: http://www.mingw.org
On Linux and Macintosh, timbreIDLib will statically link the FFTW library. On Windows, you will either have to set up an environment variable to point to the location of libfftw3f-3.dll, or simply put libfftw3f-3.dll directly in the timbreID directory.
Cheers~
Pure data Random endless list of errors?
Currenty outputs no sound?
input channels = 0, output channels = 0
input channels = 0, output channels = 0
tried /Applications/Pd-extended.app/Contents/Resources/extra/libdir/libdir.pd_darwin and succeeded
tried /Applications/Pd-extended.app/Contents/Resources/extra/vanilla/list.pd_darwin and succeeded
tried ./extra.pd_darwin and failed
tried /System/Library/Fonts/extra.pd_darwin and failed
tried /Library/Fonts/extra.pd_darwin and failed
tried /Users/joelnash/Library/Fonts/extra.pd_darwin and failed
tried /usr/X11R6/lib/X11/fonts/TTF/extra.pd_darwin and failed
tried /System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/lib/fonts/extra.pd_darwin and failed
tried /Users/joelnash/Library/Pd/extra.pd_darwin and failed
tried /Library/Pd/extra.pd_darwin and failed
tried /Applications/Pd-extended.app/Contents/Resources/Scripts/../extra/extra.pd_darwin and failed
tried ./extra/extra.pd_darwin and failed
tried /System/Library/Fonts/extra/extra.pd_darwin and failed
tried /Library/Fonts/extra/extra.pd_darwin and failed
tried /Users/joelnash/Library/Fonts/extra/extra.pd_darwin and failed
tried /usr/X11R6/lib/X11/fonts/TTF/extra/extra.pd_darwin and failed
tried /System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/lib/fonts/extra/extra.pd_darwin and failed
tried /Users/joelnash/Library/Pd/extra/extra.pd_darwin and failed
tried /Library/Pd/extra/extra.pd_darwin and failed
tried /Applications/Pd-extended.app/Contents/Resources/Scripts/../extra/extra/extra.pd_darwin and failed
tried ./extra/extra-meta.pd and failed
tried /System/Library/Fonts/extra/extra-meta.pd and failed
tried /Library/Fonts/extra/extra-meta.pd and failed
tried /Users/joelnash/Library/Fonts/extra/extra-meta.pd and failed
tried /usr/X11R6/lib/X11/fonts/TTF/extra/extra-meta.pd and failed
tried /System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/lib/fonts/extra/extra-meta.pd and failed
tried /Users/joelnash/Library/Pd/extra/extra-meta.pd and failed
tried /Library/Pd/extra/extra-meta.pd and failed
tried /Applications/Pd-extended.app/Contents/Resources/Scripts/../extra/extra/extra-meta.pd and succeeded
tried ./pdlua.pd_darwin and failed
tried /System/Library/Fonts/pdlua.pd_darwin and failed
tried /Library/Fonts/pdlua.pd_darwin and failed
tried /Users/joelnash/Library/Fonts/pdlua.pd_darwin and failed
tried /usr/X11R6/lib/X11/fonts/TTF/pdlua.pd_darwin and failed
tried /System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/lib/fonts/pdlua.pd_darwin and failed
tried /Applications/Pd-extended.app/Contents/Resources/Scripts/../extra/extra/pdlua.pd_darwin and failed
tried /Users/joelnash/Library/Pd/pdlua.pd_darwin and failed
tried /Library/Pd/pdlua.pd_darwin and failed
tried /Applications/Pd-extended.app/Contents/Resources/Scripts/../extra/pdlua.pd_darwin and failed
tried ./pdlua/pdlua.pd_darwin and failed
tried /System/Library/Fonts/pdlua/pdlua.pd_darwin and failed
tried /Library/Fonts/pdlua/pdlua.pd_darwin and failed
tried /Users/joelnash/Library/Fonts/pdlua/pdlua.pd_darwin and failed
tried /usr/X11R6/lib/X11/fonts/TTF/pdlua/pdlua.pd_darwin and failed
tried /System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/lib/fonts/pdlua/pdlua.pd_darwin and failed
tried /Applications/Pd-extended.app/Contents/Resources/Scripts/../extra/extra/pdlua/pdlua.pd_darwin and failed
tried /Users/joelnash/Library/Pd/pdlua/pdlua.pd_darwin and failed
tried /Library/Pd/pdlua/pdlua.pd_darwin and failed
tried /Applications/Pd-extended.app/Contents/Resources/Scripts/../extra/pdlua/pdlua.pd_darwin and succeeded
tried ./tclpd.pd_darwin and failed
tried /System/Library/Fonts/tclpd.pd_darwin and failed
tried /Library/Fonts/tclpd.pd_darwin and failed
tried /Users/joelnash/Library/Fonts/tclpd.pd_darwin and failed
tried /usr/X11R6/lib/X11/fonts/TTF/tclpd.pd_darwin and failed
tried /System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/lib/fonts/tclpd.pd_darwin and failed
tried /Applications/Pd-extended.app/Contents/Resources/Scripts/../extra/extra/tclpd.pd_darwin and failed
tried /Users/joelnash/Library/Pd/tclpd.pd_darwin and failed
tried /Library/Pd/tclpd.pd_darwin and failed
tried /Applications/Pd-extended.app/Contents/Resources/Scripts/../extra/tclpd.pd_darwin and failed
tried ./tclpd/tclpd.pd_darwin and failed
tried /System/Library/Fonts/tclpd/tclpd.pd_darwin and failed
tried /Library/Fonts/tclpd/tclpd.pd_darwin and failed
tried /Users/joelnash/Library/Fonts/tclpd/tclpd.pd_darwin and failed
tried /usr/X11R6/lib/X11/fonts/TTF/tclpd/tclpd.pd_darwin and failed
tried /System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/lib/fonts/tclpd/tclpd.pd_darwin and
[Solved] Problem loading libraries in pd 0.47.1 (macOS Sierra)
Hi everyone,
I have a problem with loading libraries in pd vanilla 0.47.1 on macOS sierra.
I have downloaded some libraries from help > find externals.
As far as I understand it, those libraries have been added to the /Applications/Pd-0.47-1-64bit.app/Contents/Resources/extra folder (inside the application).
After installation, objects from some libraries create but with the added library name ([cyclone/midiparse], for example), while objects from other libraries such as zexy won't create at all.
I have added the names of those libraries in Preferences > startup as shown in the picture, that helped as now objects from zexy do create but I still need to type [zexy/...] before the object. This would be fine for new patches, but is a problem to open patches created by others.
In Preferences > path I have added the local folders where I keep my library of abstractions, I would add the /Resources/extra folder too but I can't choose that path since it's inside the app itself.
Does anyone know the steps to load all the libraries at startup so that the objects create without the need to type the library name in front?
Thanks very much for your help.
Help?! Implementing Pd into a hardware device
@Lemon £uk 30 will buy you (on ebay...... there is one without bids 53 minutes left) a windows 7 laptop, with screen, keyboard, power supply, trackpad and a 320Gb hard drive.
You will spend more than £30 on a basic computer (raspberry Pi.....)......... when I say basic, I mean without a power supply, keyboard, screen or trackpad.
And if you are not familiar with Linux you will have some extra learning to do, and you will need to learn how to communicate with your small computer that has no screen.
If size and weight are important for your project you will find a lot of help on this forum with all types of computer
I would recommend learning about Pure Data, following some tutorials, and building your patch(s) on your laptop while at the same time you gather as much info about the options as you can..... before you decide.
A Pd patch will run on Linux, osx, and windows so you can just load it up on the small computer of your choice when (or if) you decide to buy one.
For 3 audio inputs or more you will need an external soundcard...... and there is a huge range at reasonable prices that will work with windows 7. You will need to research which ones will work well with the Pi and others.
David.
Pure Data noob
Ok...... So I have been meaning to do this for a very long time......
I don't think it is the perfect "show_me_dollars" and so I will change it from time to time.
3rd attempt.........
show_me_dollars.zip
Here is a really terrifying screenshot, but I have also tried to explain it in words.
In many ways I think words ( below the screenshot) are easier to understand.
David.
Dollar $ variables in Pure Data patches.
A dollar variable is a thing that can be given a new value.
The new value can be a float or a symbol.
- If the Dollar variable is in an [object] box
A Pd patch can be saved and used inside another patch. We then call it an abstraction.... and it is just like a programming sub-routine.
If you want to use it many times then you have a problem, that they are all the same, so if you put an object [receive woof] they will all receive any message that you send with [send woof].
That might well be what you want to do.
But what if you want to send the message to only one of them?
You can give it an [inlet], but your patch will get messy, and what if your patch needs to make its own mind up about which abstraction it wants to send the message to, maybe depending on which midi note it received?
The solution is to give the abstraction arguments... some parameters that define it and make it different to the other copies.
For example [my_abstraction]
Let’s give it some arguments [my_abstraction 5 9 woof]
Inside the abstraction, as it is created (you open its parent patch) the dollar variables will be replaced. Wherever you see $1 written IN AN OBJECT it has been replaced by the number 5.
Number 5 because 5 is the first argument and has actually replaced the $1. You still see $1, but if you bang a [$1] object it will output 5.
[f $2] will output 9
[symbol $3] will output woof
So if you have an object [receive $1-$3] then it has now become [receive 5-woof]
And if you want to send it a message from outside, from another patch or abstraction, you will need to use [send 5-woof]
Every Pd patch, which remember includes your abstractions, also has a secret number. The number is unique and greater than 1000. As Pd opens each patch it gives it the number, increased by one from the last number it gave.
That number will replace $0 as the patch is created. You can find out what the number is by banging a [$0] object and connecting its output to a number box, or [print] object.
$0 can be used in any object as part of the name or the address, which means that a message cannot escape from the abstraction. A sub-patch like [pd my-subpatch] will be given the same number.
But from outside your abstraction you don’t know what it will be when the patch is created, so it is not useful. (A lie, you can find out, but as it can change every time you open your patch it is not worth the bother).
Use it to send messages within your patch [send $0-reset] to [receive $0-reset] for example, because the message is absolutely unique to its window, so you know it cannot interfere with other abstractions.
Use it also for objects like [delwrite~ $0-buffer 100] or for an array name [array $0-array] so that in each abstraction they have a different name and you will not have problems with their being "multiply defined"...... as each name can only exist once in your patch.
- If the Dollar $ variable is in a [message( box
Dollar $ variables are also replaced, but not as the patch is created (drawn by Pd as you open it).
Dollar zero $0 has no meaning in a message box. It will produce a zero if the message is banged, but that is it.
It is a mistake, a patching error, to put a $0 in a message box.
$1 $2 $3 $4 etc. in a message box are replaced by incoming atoms (individual floats or symbols or whatever) when they arrive. $1 will be replaced by the first atom in the list, $2 the second etc.
So if you have a message box [$1 $2 $3( ..... and you send into it a list [3 48 lala( .....then it will output 3 48 lala
That is not really very useful.
But it is actually very powerful.
Make a list in a message box........ [33 12 wav(
And bang it into a message box [open my-track$2-$1.$3( and you will get the output.........
open my-track12-33.wav
Which could be just the message that you want to send to [soundfiler]
P.S. If the first item in the incoming list is a symbol then it will be dropped causing errors.
You can fix that by making the message a list by passing it through the object [list].
Unfortunately only messages starting with a float are automatically recognised as lists.
Custom Ubuntu Live Cd and PD
@flextUser Hello....... A custom Ubuntu Live cd will be running Ubuntu on the laptop...... so the fact that it ""was"" a windows machine is irrelevant. The live cd will need to run on that machine........ have all of the video/audio etc. drivers that will work on that particular machine......
Linux is pretty good at that now, but you will need to check on the actual hardware.
Then you might need the drivers for his hardware, soundcard, joystick, etc.
Depending on the complexity of your patch the usb stick will need to be fast enough.
I would try running the basic live cd first, with your patch on another key, and see what needs to be downloaded/added to get it all running (on their machine)....... if it will run straight away then you are lucky.
Yumi....... http://www.pendrivelinux.com/yumi-multiboot-usb-creator/ I have used and it is not bad for getting going with the Linux Ubuntu drive......... from then on you will start to get an idea of the possible problems. Make sure that you take the option to have a writable file on the drive so that you can save setting, preferences etc.
The computer that you are going to boot from the drive will need a bios where you can put "boot from usb drive" (or similar) to the top of the boot order.............
There is a lot of useful help on the left side of the web page that I linked to.........
Ps again! I didn't mention....... but its very important...... that the usb Ubuntu, Pd etc. must not write to the computer hard drive while it is running....... as the windows that is installed will not know about the writes........ and that will risk windows not booting again afterwards when the Ubuntu key is removed and the computer is rebooted normally......
David.
Pure Data noob
We have all been there............
You have an abstract idea, and you are hard pressed to get ahead and build your patch!
But before you start....... you have to “know”...... at least......... that this.............
Is the same as this..........
Well........nearly. There is in fact much more in the second patch.
And although the second patch is not perfect (in fact there are many mistakes), it is much easier to work with (and easier to find those mistakes).
You can build the first patch in about 2 minutes using just two components (abstractions) of the second patch. An abstraction is a patch... like a subroutine... that you can use over and over again.
Why is this important?
Because at some point your patch will become very messy, and if you are unlucky then it will stop working. You will not be able to see the mistake in the giant cobweb that you have created...... and when you finally spot that mistake you will have to fix it in 200 different places!
It is quite likely that you will then delete important items or connections by accident and cause more problems...... and not finish your project on time.
If you have a new brainwave with the first patch then you will be eating your breakfast after a sleepless night with your patch. With the second you will be hearing the result within minutes.
Please study the attached patches for as long as you can remain interested. They are difficult if you really are a complete beginner. If you have more experience then you will of course understand a lot more...........
If none of that is even remotely understandable then you have missed out on the basics.
It is much easier to use a dishwasher if you know where to put the soap and that it needs mains electricity to work at all......... http://puredata.info/docs/manuals/pd/x2.htm
DO NOT read chapter 2.9 yet.
( I have tried to explain some of the workings, especially the use of $ variables within an abstraction. (PLEASE SEE THE POST "show_me_dollars" BELOW IF YOU DO NOT UNDERSTAND THE USE OF "$"))
Try to remember while you are working that there is almost always a better (and easier) way to build your patches. Look in “soundbox.pd” as well for some $ clues!
As your project progresses you might come back here again, having found that you are able to create abstractions of your own. You will then be amazed at your understanding of what I am sure looks very difficult at this first glance!
Please do glance........it will do you good in the long run......
Pd noob.zip
David.