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

To be able to reference same dynamic feedback Lua script in multiple mappings #1229

Closed
helgoboss opened this issue Sep 24, 2024 Discussed in #1219 · 2 comments
Closed

To be able to reference same dynamic feedback Lua script in multiple mappings #1229

helgoboss opened this issue Sep 24, 2024 Discussed in #1219 · 2 comments
Labels
enhancement New feature or request realearn Related to ReaLearn
Milestone

Comments

@helgoboss
Copy link
Owner

Discussed in #1219

Originally posted by KennyG5000 September 21, 2024
This would look like the same implementation for reusing Lua scripts across multiple MIDI script sources introduced in 2.16.0, just for dynamic feedback Lua scripts in this case thanks.

@helgoboss helgoboss added enhancement New feature or request realearn Related to ReaLearn labels Sep 24, 2024
@helgoboss helgoboss added this to the 2.16.9 milestone Sep 24, 2024
@helgoboss
Copy link
Owner Author

Implemented in those commits. Accidentally associated with #1219 (the discussion) instead of the issue.

@github-project-automation github-project-automation bot moved this from In Progress to Done in Helgobox Development Sep 26, 2024
@helgoboss
Copy link
Owner Author

helgoboss commented Sep 27, 2024

Test import:

{
    kind = "MainCompartment",
    version = "2.16.9",
    value = {
        mappings = {
            {
                id = "xZgKK432NHTMRxJsGE3l3",
                name = "1",
                source = {
                    kind = "Virtual",
                    id = 0,
                },
                glue = {
                    step_size_interval = {0.01, 0.05},
                    step_factor_interval = {1, 5},
                    feedback = {
                        kind = "Dynamic",
                        script = [[
local compartment = require("compartment")
return {
    feedback_event = {
        value = compartment.text
    }
}]],
                    },
                },
                target = {
                    kind = "Dummy",
                },
            },
        },
        common_lua = "return { text = \'hello world\' }",
    },
}

Enabling virtual feedback logging will show that it uses the text provided by the common compartment Lua.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request realearn Related to ReaLearn
Projects
Status: Done
Development

No branches or pull requests

1 participant