Lissa Executable / ofxOfelia compile error (Solved)
@cuinjune I tried to compile the lissa seq patch. but when i open the executable it opens only a small empty window.
i also tried to compile a help patch for testing, with the same result.
but your example works fine(Win32Example).
Create standalone application
pd extended offered this functionality as a built in feature from what I hear. Unfortunately, pd-extended is a bit dated and no longer maintained... that said, if your patch does not require features from the latest releases of puredata, you could build it in extended and use it's make-app function. If that won't work for you, then making a standalone app from a puredata patch is still possible, but not exactly a simple task. There are actually several ways that you could do this, all of which will likely require some knowledge of coding in other languages like C, java, python etc. If you were looking to make something for mobile devices, there are apps available that can wrap your patch to run in it's own app container type of thing in android and ios. For that, check out pddroidparty, libpd and mobmuplat. If you want to run a patch as a vst type plugin within a DAW, check out pdpulp, chamomile and the one that is i think windows only, pdvst.
If your only need to make a standalone app is to cater to people who are less computer savvy, then I would say that the amount of effort it would take to make a truly standalone app from a pd patch is probably overkill and then some. You could much more easily make a patch that functions somewhat like a standalone app, in that you click an icon and the patch opens up and runs, by creating a launch script. How you would go about doing this would depend on what OS you are using. OSX and linux both run on unix, so a bash script that launches pd and opens the patch with all the desired settings could be written, marked executable (sudo chmod +x <filename>) and assigned an icon. A script could even be made to automate the installation of puredata to go with it.
If you want to be really thorough, you could compile/build a version of puredata from source, making sure all the needed dependencies are contained within the source directory and linked accordingly, and house it in a bundled folder (something like all applications and .kext files on OSX operate,) But once again, this would have some caveats, has it's own learning curve and is generally no simple task for someone who isn't already well versed in these types of things. The easiest thing would probably be to just install pd for your clients manually or via script and make a launch script that they can just click on and have it automatically open pd and the patch of choice.
Hope that helps
IAC Driver
I'm going to have to plead myself stumped once more I'm afraid. I really like the concept of MIDI routing without using Audio/MIDI setup, and MidiPatchbay is easy enough to use, but the patch is still not connecting as I had expected it to (somebody only barely understands the basics of computer science if claiming so isn't hubris on my part). My process is as follows:
-
Start MIDIPatchbay, create a single universal MIDI strip with both input and output - name "PD-Input"/"PD-Output" for reference. Allows all notes, allows all messages, clocks in real-time.
-
The patch itself doesn't show up in Audio/MIDI setup. That's fine, as I understand it the MIDI signal is traveling through MIDIPatchbay anyways. IAC is turned off and no software instruments are installed. I can close down Audio/MIDI setup and ignore it.
-
Start Mainstage, make sure that the volume is up, a patch is readied, and that Mainstage recognizes that there is a MIDI input available. Mainstage recognizes "1 MIDI input available"
-
Start PD-Extended and open the Sequencer patch.
-
Go through the process of making sure all components of the patch are functioning (it has a sequence tempo set, all the notes are active, volume is up, all the usual goodies).
-
Check DSP to on (I don't think it's necessary, but I tend to idiot proof my processes).
-
Set MIDI output from PD-Extended to "PD-Input" from MIDIPatchbay.
At this point I have all three pieces of software running, I believe in the correct order, and connected to one another with the only glitch being that I don't get a lick of audio. I'll dump the patch here for reference:
I try to keep things fairly self-explanatory in terms of sends/receives and with comments within the object arrangement, but here's hoping it's legible. If the problem is in the coding of the patch I can take it across to that section of the forum. That said, even making a simple patch to create a note with set number, velocity, and duration on manual bang and send through the midiout doesn't seem to be arriving to Mainstage. I suppose I could use one of my other programs capable of MIDI synthesis, but that seems superfluous.
I really appreciate the help, I've worked with PD less frequently over the past five years or so than when I was first learning the ropes; it always seems like I have to re-learn a few things as well as double check on my knowledge of possible objects to use... Always something new.
Playing sound files based on numbers/sets of numbers?
@whale-av Hello, first I just want to say thank you very much for your help and sorry for not replying sooner, I read all the messages, I just didn't want to bother people before I had an actual issue or a question that I understood enough to know how to ask what to do next. So that's why I'm only replying now. And you're totally right, I have suffered and learned in the past day so my brain's kind of all over the place right now, I'm still struggling to get the hang of this and really understand the patches you sent me (thank you so much for taking the time to make them for me!).
To answer your questions, I will not be assessed for this part of the project, it doesn't matter much how I do it as long as it works because no one will look at the project anyway, the end result is what matters in this case. The only "limitation" is that it has to be done in Pd. Also, my version of Pd is Vanilla (I'm assuming that doesn't change your patch much since you said it'd work in that version), and actually no, there's not really a next stage to this project; all I'm supposed to do is get my sound files to play in a loop when I press Enter (after I've typed all my numbers) and to be able to stop the loop again with Enter. I probably should have mentioned that oops, does that mean I need another keyup object or would the one in the patch work for both starting and stopping the sound?
I actually had a patch of my own but it was very simple and mostly improvised based on what I managed to learn (like I said, completely new to this) and nothing like yours so it probably wouldn't have worked anyway... Is it ok if I use your patch as a starting point? If it is, I'm assuming the next step would be the abstractions. From what I understand, abstractions are used for referencing and reusing old patches in order to keep the new patch clean and not messy. I do need something like that, as I have 17 wav files ready to use. But not all 17 should be used in one loop. I actually only need 5 sound files per loop (like in your patch), but the total number of files I can choose from is 17. To be able to tell the program which file to play based on its corresponding number I probably need the select object, right? Would I need it within the calling patch or the patch being called, a.k.a. abstraction (if my thinking is right, it's probably the calling patch)? There's probably an easier way to do this than an x number of select objects but I'm just not familiar enough with the program, sorry... Also, what difference does it make if it's not 1-digit numbers, but 2-digit, 3-digit and 4-digit combinations? To be more precise, the first, second and fourth sound file should correspond to a 2-digit number, the third to a 3-digit number, and the fifth to a 4-digit number (and I can't change this unfortunately, it's part of the task).
Oh, and is there a way I can make this work on any computer, for example if I copy my files onto a flash drive? Or if I can't, would it drastically affect my main patch if I changed the sound file destinations later, once I know what computer is going to be doing all this? Would I need to change the file destinations in all the patches or would it be possible to do so automatically via abstractions, by changing them in the main patch only (probably not but eh I asked...)?
This is all probably waaay too advanced for a beginner (and I have no idea why they'd give me this task without any prior preparation.......) so I realize I might be asking for too much here, and maybe I'm getting ahead of myself, but I still hope you could give some advice on what to do from here, what's the next step, the elements I need to get this done etc. I'm not in too much hurry, I have time until the 5th of February, so it's ok if you don't have the time for me right now, I can wait a bit!
Thank you so so so much, even just sending me the first patch was such a huge help, thank you! And I hope you can guide me through this for a bit longer!
getting started with webPd
Hi all. I'm having trouble testing Pd patches via webPd as instructed in this step-by-step guide .
I've made a patch (using only the available objects) that includes a synth and a "dsp 1" message so that when the patch is loaded a middle C should start sounding. I included this patch in a folder with webPd.js and jquery.js libraries, and followed the example for the index.html file. To mock same origin policy, I used python through the terminal to enable a web server using the "python -m SimpleHTTPServer" command line, and got the following on the terminal:
Serving HTTP on 0.0.0.0 port 8000 ...
Which seems fine, however, whenever I access the link http://localhost:8000/index.html, I got no sound at all despite the fact everything seems ok in the terminal:
1.0.0.127.in-addr.arpa - - [16/Dec/2016 14:39:07] "GET /index.html HTTP/1.1" 200 -
1.0.0.127.in-addr.arpa - - [16/Dec/2016 14:39:08] "GET /js/jquery.js HTTP/1.1" 200 -
1.0.0.127.in-addr.arpa - - [16/Dec/2016 14:39:08] "GET /js/webpd-latest.min.js HTTP/1.1" 200 -
1.0.0.127.in-addr.arpa - - [16/Dec/2016 14:39:08] "GET /patches/myPatch.pd HTTP/1.1" 200 -
I tried as well running things locally in Firefox by changing the "security.fileuri.strict_origin_policy" to false. I'm using Firefix 48.0.2.
I wonder if I'm missing something very obvious but I've checked the index.html and it includes the Pd.start(), and so the patch should start sounding when the url is loaded (shouldn't it?). Also, I think the problem lives in the way I'm avoiding the same origin policy since b2renger webPd examples (which run online) also won't run locally on my machine.
Any hints on what I'm doing wrong? Here's my patch myProject.zip
Cheers
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.
libpd on mac: clarification requested on expected behavior of cpp sample
Thanks for those links Monetus. I'm pretty close with my existing setup and will first try to work with that when I have some more time. Some of the output from the samples/cpp/pdtest appears to be as expected.
However, from main.cpp
cout << endl << "BEGIN Patch Test" << endl;
// open patch
Patch patch = pd.openPatch("pd/test.pd", ".");
cout << patch << endl;
// close patch
pd.closePatch(patch);
cout << patch << endl;
// open patch again
patch = pd.openPatch(patch);
cout << patch << endl;
// process any received messages
//
// in a normal case (not a test like this), you would call this in
// your application main loop
pd.processFloat(1, inbuf, outbuf);
pd.receiveMessages();
cout << "FINISH Patch Test" << endl;
the response
BEGIN Patch Test
Patch: "pd/test.pd" $0: 1003 valid: 1
Patch: "pd/test.pd" $0: 0 valid: 0
Patch: "pd/test.pd" $0: 1005 valid: 1
PD: PATCH OPENED: 1003
print: 0
PD: PATCH OPENED: 1005
print: 0
FINISH Patch Test
seems right but no patch was opened and if I already opened that patch before running the executable, none of the print messages (called later in the code) showed up in the console of pd. I'll focus on this and try to repost to the forum when I have a better idea of what is going on.
Loading a pure data patch ( .pd file ) within a pure data patch ( .pd file )
HI!
Quick version:
My folder structure:
/mother-patch.pd ( main pure data patch first loaded and running... )
/patches/1/main.pd
/patches/2/main.pd
/patches/3/main.pd
...
How i could open /patches/1/main.pd triggered by some action in the mother-patch.pd?
How i could close /patches/1/main.pd triggered by some action in the mother-patch.pd?
Long read
I'm attempting to clone the Critter and Guitari organelle ( link ).
This instrument is basically a computer running libpd and running very cool pure data patches
You can read more about my project here ( link )
I have a mother pure data patch that it's first loaded when the device is on, this patch is doing some [send] and [receive] operations related to the knobs/keyboard/volume/led and it should be also managing the loading ( opening and closing ) of the child pure data patches ( mentioned above ). This child patches are receiving the actions from the mother patch.
If I open the mother patch and the child patches manually, everything works fine. But now I need to OPEN this CHILD PURE DATA patches with a object within the mother patch.
I've been testing [open] , for opening the main.pd of the child patches but it does not work.
I've been testing [pd] , for opening the main.pd of the child patches but it does not work.
I wouldn't like to modify the original organelle patches.
I wouldn't like to end up loading all the patches using [pd ...] and inserting a [switch] object inside every main.pd file in the patches in order to enable only the dsp of the desired patch.
It would be perfect If i could have a folder with all the patches and load them within the mother patch with some kind of object. And I would also want to be able to CLOSE the pure data patch and open another ( changing patches... )
Every little and big help woul be MUCH APRECIATED!
THANKS!!!!!!!
Running your patches on Android usind PdDroidParty in 10 Steps
There is actually several options here
-
either you are a developper so you can directly use libpd as an audio engine, and use the api to send or receive data from your patch to/from you favorite language (c# c++ java etc.) you can then create your ui in this programming language. Plasma sound uses a mix of android specific code and the processing-for-android drawing api. With this method you need to use something like eclipse or android studio but you can create binary signed apps that you can upload to the android store. (it works great, I've published several apps with this combination).
-
either you want to stick with pd :
1- pddroidparty will run your patch in a specific android app emulating the pd gui with a few additions (touch surface etc.), the sources from Chris target android only. But Pd-party by danomatika will target ios soon (now beta I think).
2- mobmuplat is also a very neat project, where you can do probably a little more with the graphics. android and ios.
3- sceneplayer on android is also a way to read patchs on android, it provides a way to display/hide and move images too. It target android, the ios version rjdj is sadly long lost.
4- ppp mentionned before, will help you publish app using pd as a wysiwyg editor in the same way of pddroidparty, but you'll end up with a signed binary ready to distribute. It also packs a midi clock shared via wifi to sync several apps with one another.
I think it sums up all the options here.
So back to data-structures : data-structures are in libpd, but none of the projects above supports them to my knowledge, you can't display or interact with them. If you program you can probably access them through libpd, draw/manipulate them in the programming language of your choice.
New to PD, need help with notes failing to turn off.
I've been working on my first major patch for the past few months. It's a synthesizer based heavily on the tutorial on flossmanuals.net. After finally creating all of the features I wanted I started to modify the patch to make the synthesizer polyphonic. The catch is that I want to control the patch using the Mad Catz Mustang midi guitar controller. This controller works perfectly fine with the polyphonic synth in the PD help browser as well as with other polyphonic synth patches I've found online, so I do not think the controller has any problem interacting with the [poly] object.. The problem is that when I use it with my patch, some notes fail to turn off. It seems to happen most often when I quickly slur from one note to another. I did not have this issue when using the monophonic version of my patch. The amplifier subpatch is definitely receiving noteoff messages, but for some reason, they do not cause the envelope to close.
I think part of the problem has to do with the way the controller sends messages. I use the controller in 'tap mode,' meaning a noteon is sent whenever a fret button is pressed and noteoffs are sent when fret buttons are released. However noteoffs are also sent whenever any fret button is pressed in order to turn off the "open string" (A note can be played without pressing a fret button by striking the string sensors, and the only way to turn it off is by playing a fretted note). This occurs whether or not the open string is playing and I think this may be messing with [poly]'s voice allocation. I'm tempted to just say that the controller can't be worked around, but since I know it works for other patches I'm going crazy trying to fix my patch.
I understand it would be hard to duplicate this behavior without having the controller, but as I said before it works like a dream with other patches. I have tried to imitate the polyphony of these patches as best as I can. I've tried disconnecting and reconnecting objects in every order imaginable and I've tried delaying on and off messages in case they were somehow arriving to the amplifier envelope out of order.
Attached is a simplified version of my polyph[full poly help.pd] onic patch. I'd really appreciate it if anyone could give it a quick look over just in case there's anything really obvious that I'm just missing.
Thanks so much and have a great day.
EDIT: Please ignore the errors about missing {receive~}s or {catch~}es. The {send~}s and {throw~}s are for some of the features that I removed from this version of the patch for simplicity's sake but I did not remove the {send~}s and {throw~}s.