Skip to content
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

Add declare -jackname #757

Open
ritsch opened this issue Sep 24, 2019 · 7 comments

Comments

@ritsch
Copy link
Contributor

commented Sep 24, 2019

When writing pd-patches like "audio2osc.pd" or "midi2audio.pd" it would be handy to be able to open them without having to use command line and dialogs, the name their jackaudio port.
This can be done by a declare -jackname, similiar to the command line:
[declare -jackname jacker] or so.It works see patch in attachment and example.

declare_jackname.patch.txt

test_declare_jackname.pd.txt

@ritsch

This comment has been minimized.

Copy link
Contributor Author

commented Sep 24, 2019

Additional, one can also set the ALSA-MIDI name. [declare -alsamidiname jackme]
This is handy also for automatic connections within jackd.

declare_alsamidiname_jackname.patch.txt

test_declare_alsamidiname.pd.txt

@ritsch

This comment has been minimized.

Copy link
Contributor Author

commented Sep 24, 2019

Note: patches are proof of concept, maybe not secure enough...
And alsamidiname could also be added to command line options.

@umlaeute umlaeute added the feature label Sep 25, 2019
@umlaeute

This comment has been minimized.

Copy link
Contributor

commented Sep 25, 2019

please provide a proper pull request, that can be reviewed and merged/cherry-picked.

apart from that: what is the expected behaviour if i have an patch that has [declare -jackname wini] and another one - loaded in parallel - that has [declare -jackname IOhannes]?

when doing "automatic connections with jack", i need to customize my environment (outside of Pd) anyhow, so why can't i provide start-script?

I understand the need to be able to create self-sufficient "applications" from Pd-patches, but I don't think that [declare] is the proper hook for implementing this part.

@ritsch

This comment has been minimized.

Copy link
Contributor Author

commented Sep 25, 2019

When we discussed the benefit of this feature, i will provide pullrequest, (after reading the docs for pull requests ;-)

doubled declare:

There should be only one declare active, but why not change this during runtime take the last, it is a programming language, so you have to know what you code...

need:
When I have aj-snapshot or qjackctl with a patch the right tool will connect only correct if the jacknames are identified for different connections. So If i wand a specific MIDI-IN connected to the tool which maybe sends OSC data, I have to click on midi2osc.pd and it connects. parallel I want a second pd with audio2osc for monitoring different inputs like ambisonics_monitor.pd connects to the ambisonics bus, synthi_monitor.pd to the synthi etc.... as smal tools
or simply I can see on jack which is which, when I forget in what order I started them...

and yes, it is a mess, that the patch opens with the same pd, if i have parallel pds, i never know where my patch runs... this should be disabled somehow in the desktop I think ... ( I have a script: "pd $@" which opens my patches to prevent this).

@Spacechild1

This comment has been minimized.

Copy link
Contributor

commented Sep 25, 2019

[declare] is used for search paths and -jackname rather belongs to the audio settings. my suggestion would be to add "jack name" to Pd's audio settings dialog. if you update https://git.iem.at/pd/mediasettings accordingly, you would be able to set the jack name programmatically.

@ritsch

This comment has been minimized.

Copy link
Contributor Author

commented Sep 25, 2019

[declare] is used for search paths and -jackname rather belongs to the audio settings. my suggestion would be to add "jack name" to Pd's audio settings dialog.

In my opinion, all command lines should be also be set by declare.

Not only, but most one-filer pd patches can be opened and set the parameters, like also channel count and connection name. Especially channel count is crucial for a patch.
Also it would be nice to say where to connect, but that should be handled by the environment, since it is part of system integration of Pd. As a start the jackname and midialsaname would help me in this situation, calling one Pd-Programm (I am mean .pd file) in a graphical gesture like klick on it. Additionally to have it in mediasettings is great.

if you update https://git.iem.at/pd/mediasettings accordingly, you would be able to set the jack name diagrammatically.

This would need to have always this library installed and I want my patches to work (mostly only) on vanilla. Anyway there are many ways to achieve this, but non straight.

@Spacechild1

This comment has been minimized.

Copy link
Contributor

commented Sep 25, 2019

In my opinion, all command lines should be also be set by declare.

hmmm... this is actually an interesting idea but we have to investigate which command line arguments would work because some obviously can't/shouldn't be changed after the fact, e.g. -gui / -nogui or -rt / -nrt. Also, some options maybe can't/shouldn't be changed individually.

BTW, I think I found a solution for your particular use case which already works in current Pd: make a preference file and in your patch do [;pd load-preferences <pref-file-path>(. Actually, this already allows you to set most command line options programmatically, so I'm wondering if adding command line options to [declare] is really needed...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.