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

Build a meta language for generating/building presets #393

Closed
helgoboss opened this issue Jun 26, 2021 · 6 comments
Closed

Build a meta language for generating/building presets #393

helgoboss opened this issue Jun 26, 2021 · 6 comments
Labels
enhancement New feature or request high priority

Comments

@helgoboss
Copy link
Owner

Building complex control scenarios is possible but sometimes a daunting task. It's hard to reuse a bunch of little mapping groups and put them to use in a slightly different context within the same preset. E.g. same tuning settings but different target tracks and sources. See my synth control unit.

The best way to build complex stuff while still keeping sanity and not entering maintaince issues is still using a programming language, with variables, loops etc. ReaLearn has JSON, so we can generate that using a high-level builder-like language. There should be some concenience for targeting specific tracks with IDs.

@helgoboss helgoboss added the enhancement New feature or request label Jun 26, 2021
@patmaddox
Copy link

Sounds interesting and I see what you mean. Once I got a control set working for one knob, the process was something like:

  • duplicate first mapping, change source, change parameter expression
  • duplicate second mapping, change source, change parameter expression
  • duplicate third mapping, change source, change parameter expression, change target
  • duplicate fourth mapping mapping, change source, change parameter expression, change parameter value

for each remaining knob.

What do you have in mind for this? Would this be a utility outside of the ReaLearn plugin that you use to generate JSON, and then import it? Or do you have some way of it being part of the plugin?

@helgoboss
Copy link
Owner Author

My idea is to write a little nice-to-use library for an easily accessible programming language (probably JavaScript/TypeScript). This library would then allow you to easily construct mappings and provide functions for typical usage scenarios.

Code would be written outside of ReaLearn. There are awesome IDEs and code editors out there which provide syntax completion and other stuff for free. However, maybe I will connect the two, so you only have to save the code in the editor and ReaLearn automatically loads the result.

@patmaddox
Copy link

Okay cool! Good to know the plan is to use an external tool to generate JSON to import to ReaLearn.

I'm doing lots of repetitive mapping, so I'll want to poke around at the JSON and probably script some stuff anyway. I don't anticipate building a lovely meta language as you say, but maybe some of the scripts will be helpful to people in the short-term, and will help suss out specific use cases. I suspect that some things are easily scriptable (sources), and other things aren't (certain targets, like project-specific tracks).

@helgoboss
Copy link
Owner Author

I'm doing lots of repetitive mapping, so I'll want to poke around at the JSON and probably script some stuff anyway. I don't anticipate building a lovely meta language as you say, but maybe some of the scripts will be helpful to people in the short-term, and will help suss out specific use cases. I suspect that some things are easily scriptable (sources), and other things aren't (certain targets, like project-specific tracks).

Sounds wise. Not much time for ReaLearn these days, I think I will get back to it in autumn and this particular issue is not on the top of my list.

You are right that targets are harder to script because they are more diverse. And yes, if you want to refer to a specific track/FX by its ID (I often do), you need to mention that ID in the script. I have an idea how to get around this: Offering an action in the ReaLearn right-click menu that converts all things that are referred to By position or By name to "By ID". That way the script itself could use positional/naming logic. But I need to give this a bit more thought.

@helgoboss
Copy link
Owner Author

Just an update: I'm working on this and my language of choice (that ReaLearn itself will be able to execute) is Lua. Actually a nice language for building data structures and REAPER power users already know it.

However, there will also be a JSON Schema and/or TypeScript type definitions, so programming ReaLearn presets in other languages that can output a data structure as JSON should be easy (just not executed by ReaLearn itself).

@helgoboss
Copy link
Owner Author

Implemented in #62

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request high priority
Projects
None yet
Development

No branches or pull requests

2 participants