-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Script-based plugins(effects, controllers, etc.) #551
Comments
A few technical details about the equation solver:
|
It sounds cool and I don't think a slower app is a problem as that is a natural part of the deal with scripted stuff, but wouldn't support for one of the bigger languages csound or pd be a more natural path? |
Maybe, but I think they might be more complicated to code into LMMS, and for many C developers, they might be more work to learn. Also, you can not easily port them into LADSPA or similar effects, as they are not really C. |
I think in addition to what you are saying here Johannes what would be On Tue, Apr 1, 2014 at 3:23 PM, JohannesLorenz notifications@github.comwrote:
Jonathan Aquilina |
Am Dienstag, 1. April 2014, 07:31:36 schrieb eagles051387:
You mean so you could copy parts of existing C code into the script editor? Independent from that, web based versions of code/Doxygen are actually never a |
That would eliminate the need to compile them when you compile lmms. @toby Could we host doxygen generated documentation on SF? On Tue, Apr 1, 2014 at 4:38 PM, JohannesLorenz notifications@github.comwrote:
Jonathan Aquilina |
As it happens, I was just thinking about something similar just the other day. There's some considerations:
So of course, these two goals are in direct contradiction with each other. C syntax is harder, whereas Python is too slow... Ideally, we should develop our own scripting language, which is optimized for audio work, and has a syntax suitable for non-programmers (like python). But then, do we really have time/resources to do that? Anyway, this could all be implemented as an effect plugin with an embedded interpreter, so there's really nothing stopping you from doing this within the existing plugin framework of LMMS. |
IMO, using an existing language would be wise, one with a user base, tutorials, years of development and so on. Before starting on an in-house solution, it'd be good to do some serious evaluation of the existing alternatives, on points like:
There are 7 BSD|(L)GPL alternatives in the list over there, maybe one of them fits: |
On 04/02/2014 10:33 AM, Raine M. Ekman wrote:
I've heard some good things about ChucK, and it seems like an |
Just btw: Why not let the plugin compile C code? There are only two cases:
This will cause some (very few) people to not be able to load some songs, but So what's so bad about compiling? |
...99% of Windows and OS X users won't be able to use that feature. Besides that, compiling of course would be the best option for optimal performance. |
Am Mittwoch, 2. April 2014, 03:40:01 schrieb Tobias Doerffel:
Agreed, but the same argument would count if I give a Windows user my song That's why I'd suggest trying to write code that does this. |
On 04/02/2014 01:40 PM, Tobias Doerffel wrote:
Well... Windows/OS X users won't be able to use LinuxVST at all, OS X This is just my opinion, but personally, I don't see it as much of a |
Here's a volume control plugin in FAUST (minus some metadata and a library import):
I think something in this direction is what's needed if we talk compiled code:
IOW, hide all the stuff that isn't strictly needed and let the plugin writer focus on the DSP code. Maybe restrict him/her to what's in math.h and no more. Or maybe just use FAUST, if the syntax is good enough. Maybe this actually is something that could be in a separate program, with suitable hooks to make it work smoothly with LMMS but also usable as a stand-alone code generator? |
Could a compiled script's binary code be kept in MMP file so the plugin can That however could be a major security risk.
|
On 04/03/2014 02:38 AM, unfa wrote:
Yeah let's not do that. |
Shouldnt the presets effects etc have their own extension so we can On Thu, Apr 3, 2014 at 1:38 AM, unfa notifications@github.com wrote:
Jonathan Aquilina |
Am Mittwoch, 2. April 2014, 16:38:37 schrieb unfa:
Putting in binary code is an extremely bad idea imo:
LMMS is open source and should never encourage people to develop closed source |
I agree here. Also note that popular plugins can later still be compiled into LMMS, so Toby, will you accept code that allows C++ source code in XML project files? |
If you want a language that is good for concurrency check out google's from what I have seen the syntax is very easy to work with too. On Wed, Apr 2, 2014 at 10:48 AM, Vesa V notifications@github.com wrote:
Jonathan Aquilina |
I for one wouldn't support that. It is way too difficult, in my opinion, to sanitize C++ code so you can trust the resulting binary to not be malicious. I could share project files that infect users computers, leak personal data, or destroy the machine. I would prefer to see a restricted dialect, perhaps not even C-derived. This could be compiled to machine language or source-to-source compiled: instrument-script => C => assembly. |
On 04/03/2014 10:06 AM, Paul Giblock wrote:
Going to have to agree here... |
Thanks Paul, I've overseen this danger. However: What if we'd disallow any #includes and #defines? That way, the programmer
|
On 04/03/2014 11:29 AM, JohannesLorenz wrote:
The list of things we'd have to disallow is a bit longer I'm afraid... #includes just bring code in from headers or installed libs, disallowing Same with #defines, defines are just macros that expand to code, and We'd basically have to disallow huge swaths of code... and there'd still I don't really want .mmp files to be able to execute arbitrary binary |
I think the only language that we could really work with which is platform On Thu, Apr 3, 2014 at 10:40 AM, Vesa V notifications@github.com wrote:
Jonathan Aquilina |
Don't look at what to disallow, start from nothing and then allow things until you're happy. The C parser mentioned at the start would actually be pretty useful for sanitizing the code, if the compiler input is then built from the parse tree it's possible to only let safe things pass. |
On 04/03/2014 12:31 PM, Raine M. Ekman wrote:
I think we'd only need to allow a x number of variables and ways to Some predefined variables: input, output, sample rate, control values Some predefined functions: sin, cos, square root, addition, Upside would be that the syntax could be made very simple this way. |
When you say Linux Vst's cant you still compile them and they should run on On Wed, Apr 2, 2014 at 1:03 PM, Vesa V notifications@github.com wrote:
Jonathan Aquilina |
On 04/06/2014 02:19 PM, eagles051387 wrote:
Well, that depends of course on whether those LinuxVST's are also Also, even when we implement LinuxVST support, that doesn't necessarily |
One different idea:
This should prevent anything malicious (I guess, since the things we allow are Any comments about this? |
Have you guys considered LUA? It's designed for scripting, very lightweight and the only dependency is standard C library. Also 100% cross-platform. |
performance and security... nough said ..except, it would create a humongus confusion in explaining imho no |
It's pretty cool, and obviously for advanced users 🙏 We don't always need to target newbies, you know @musikBear |
I had the following idea: we have many plugins, but if you want to write your own for just one song, there is a long way to go:
Anyways, I have once written a C interpreter. It builds a so called "abstract syntax tree" from a string input once, and this tree can then be executed multiple times, like a compiled program. We could predefine controllers and effects that use such equations.
Example: Amplifier:
Predefined: An effect with stereo in and out, 16 knobs, and one string input.
What you do: Type "for(int i = 0; i < buf_size; ++i) { out_l[i] = in_l[i] * k[0]; out_r[i] = in_r[i] * k[0]; }" into the string input.
Meaning: out_l, out_r, in_l, in_r are predefined variables for the in/out buffers. buf_size is predefined for the buffer size. k[0] is knob 0.
Other examples: Controllers, e.g. that delay the controller signal, apply inertia to it or whatever.
What do you think about such an interpreter?
Note: I know scripts are usually slower. But once a script proves as usable, we could just move the script code into the lmms sources, since they have the same languages.
The text was updated successfully, but these errors were encountered: