-
Notifications
You must be signed in to change notification settings - Fork 327
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pd multichannel #1034
Pd multichannel #1034
Conversation
Thanks a lot but faust2puredata is the tool that has to be updated, like adding a new |
I see! I just updated the examples Makefiles because I saw they used their own copies of Apart from that, I only really changed
If I'm not mistaken, this uses faust/tools/faust2appls/faust2puredata Lines 126 to 127 in 219938c
Note that you can use the external without the UI. But if we want a working UI for multi-channel mode, we would need to update the |
I suggest we only update the |
AFAICT there is nothing to update. With the changes in
Sounds good :) |
OK, but my point is: do we want/need a specific |
I've added a |
Where that ? |
to remain backwards compatible with older Pd versions, we check the presence of signal_setmultiout at runtime and fall back to single-channel mode if not present.
no need for copy construction. I *think* this is done to force all static initialization.
On modern systems where Pd is typically running, it is extremly hard to actually run out of memory. Pd itself doesn't really check for out-of-memory errors and most externals don't either. Finally, the existing checks aren't done consistently, so let's just get rid of them.
instead reference the one in architecture/
0d99054
to
933d8a7
Compare
As a creation argument flag: That's how you typically do it in Pd if you want your object to support both modes.
|
Did you actually test this before merging? As I said, I didn't test at all! |
Ah, nevermind, I now realized you only merged into |
Can you @alainbonardi and @paulgoutmann test the pd-multichannel branch ? |
Yes, it does compile here like:
|
Cool! Now you should also build with a more recent Pd header :) |
BTW, the |
Nothing I'm aware of. |
Maybe I can find some time to update the Makefile. Or even better: integrate https://github.com/pure-data/pd-lib-builder |
@alainbonardi Thanks for testing! Did you also try
The original author decided to use the leftmost inlet for messages only, which is indeed very unidiomatic. Unfortunately, there's nothing I can do without breaking backwards compatibility... Even more confusing: the leftmost inlet is actually a signal inlet, so you won't even get an error if you accidentally make a connection. At least this is something that can be fixed. @sletz I don't know about Faust's stance on backwards compatibility, but the next time there's a release with breaking changes, we can take the chance and fix this. Another question: is there ever a situation where a Faust Ugen could have no inputs and no outputs? |
@agraef any comment here ?
Could we add an new option in
A Faust DSP code always has at least one audio output, see: |
It's been a long while since I wrote that architecture... :) Yeah, it has a pair of control inlet and outlet on the left, and the remaining iolets are for audio. I've used the same design in pd-faust and pd-faustgen2 as well. Agreed, this isn't very idiomatic, and is also at odds with Stephane's Max faustgen~ external. But I prefered it because it makes the layout more symmetric, so that you can simply wire through the audio cables if you have a bunch of dsps with the same number of audio channels in a chain. IMHO, it looks tidier in a patch that way, and it also seems more logical to do it that way if you're always going to have a single control iolet and a variable number of audio iolets on all the objects. Of course, we can argue about this until the cows come home. In principle, I'm not against changing puredata.cpp to the more idiomatic layout, as long as I don't have to do it myself. :) Concerning faust2pd, I'm afraid that this has been falling victim to bitrot as I never got around updating the Pure interpreter to a modern LLVM version. You can still get Pure up and running on modern Intel-based systems, but it's a major hassle since it requires LLVM 3.5 (the last version with the old JIT). However, if you need GUI generation then you can use pd-faustgen2. This is my fork of Pierre Guillot's pd-faustgen which has improved MIDI and polyphony support and the GUI generation stuff built into it. It also replaces my own pd-faust which was written in Pure as well, and thus is no longer palatable. :) The downside is that pd-faustgen2 doesn't have multi-channel support yet. @Spacechild1 Maybe you could port over the multi-channel support from puredata.cpp? I'll gladly accept any pull request. :) Otherwise I'll have to port it myself, and I'm always busy with too many other projects. pd-faustgen2 is also still relatively new, so at this point we might still change the iolet layout to something more idiomatic if this is what everybody wants, without major repercussions concerning backward compatibility. |
@agraef Thanks for chiming in!
That's what I figured as well after I realized that the message outlet also comes first. It's still not very idiomatic, but now I understand where you are coming from.
Note that you can do the same with the new (idiomatic) layout, as the signal inlets and outlets line up.
I'll put it on my list, but I'm always very busy as well...
That would be cool! @agraef IIUC,
So |
I guess we need first to evaluate the need of rewriting |
That's what I've been thinking as well: do people actually (still) use (BTW, one thing that is missing from |
Personally, I don't think that |
I've had a few emails over the years indicating that some people were actually using faust2pd. But I doubt that it has been used very much recently because of the Pure dependency. The GUI layout algorithm in pd-faustgen2 should still be fairly similar to what faust2pd does, so it should be possible to rewrite the Pure script to something more portable in C++, employing faust2puredata to build the external. I agree, though, that it would be much easier to write the glue code in some modern scripting language instead. Porting the layout code shouldn't be too difficult either, IIRC it's just a recursive function carrying around some accumulating parameters. Any language with decent FPL support including lexical closures should do.
That's true, but usually JIT compilation is very fast, and it's convenient because everything is built into the loader, and you don't even need to have the full Faust toolchain installed if you're just using Faust inside Pd. That doesn't make the need for something like faust2pd go away, but at least there's an alternative. Oh well, I'll see what I can do about the faust2pd port once I've finished the other stuff that's on my TODO list right now. Maybe some time next year. I've already ported a good deal of my Pd-related Pure scripts to Lua, maybe this one will be next. |
Well, if you have the generated GUI then you can just edit it to get what you want. And most of the time it will be all you need. And don't even get me started about all the necessary plumbing between GUI and external, this stuff is really tedious and error-prone if you have more than a handful of control parameters. |
Fair point. I'm totally not against offering a generated UI, I just don't find it too important. I mean, most Pd externals come without ready-made UIs. Often you just need to set a handful of parameters, which can be easily done with a few sliders or number boxes. But for that you'd need a help patch :) |
From my teaching experience (every year 40 to 50 music students working on PureData, Faust, Max, etc.) a generated GUI is very important when learning graphical languages for instance Pd. It helps a lot students to build patches connecting what they consider more as plugins than as objects, abstractions or canvas. Typically students using Pd on Windows cannot compile Faust code to make objects. Therefore they use Albert's pd-faustgen2 to implement the Faust processes with an extra subpatcher automatically generated to display the controls. Therefore I am very much in favour to have an automatically generated GUI directly from faust2puredata |
Fair enough. I'm not a teacher, so I tend to forget about the educational aspects.
That's a problem. FWIW I've already opened an issue about that: #1036 |
Python tool for Max/MSP: there is https://github.com/shakfu/py2max, that I'm using to automatically create the GUI for the Faust ==> RNBO project https://faustdoc.grame.fr/tutorials/rnbo/ Is there an equivalent Python for PD project, that could be used to build a GUI in |
Not that I know of. |
There is https://github.com/grrrr/py, but IIRC it hasn't been updated to Python 3 and doesn't seem to be actively maintained. That being said, won't really need a python external for Pd for our purposes. With |
Interesting. Thanks for pointing to this, I didn't know about it. Seems to be similar to pd-lua in scope (which has been around for a while), but with Python as the scripting language. But you're right, for faust2puredata we'd just want something which generates a static GUI as a Pd abstraction, and that can be done with just regular scripting, whether in Python or Lua. |
Sure, my point was that a library to help generate the actual PD patch could be used. For |
Ah, I misunderstood! (I didn't really check the link to https://github.com/shakfu/py2max) There are indeed comparable Python libraries for Pd, e.g. https://pypi.org/project/puredata-compiler. You are right that this would help a lot with the patch generation. |
Add multichannel support to generated Pd external.
To maintain backwards compatibility with older Pd versions, we try to find the
signal_setmultiout
API function at runtime withdlsym()
resp.GetProcAddress()
, falling back to single channel mode if not available.