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 operator overloading for declarative syntax #19

Open
3 tasks done
maxwellmattryan opened this issue Nov 4, 2024 · 0 comments
Open
3 tasks done
Assignees
Labels
type : enhancement Improves an existing feature

Comments

@maxwellmattryan
Copy link
Contributor

maxwellmattryan commented Nov 4, 2024

Description

It would be really cool to write DSP chaining code like the following:

Oscillator osc1;
Oscillator osc2;
Filter filter;
LFO lfo;

int main(void) {
    float sample = (osc1 * lfo) + osc2 >> filter;
    buffer.writeSample(sample);
}

As an explanation of the syntax:

  • osc1 * lfo - module an oscillator by "multiplying" an LFO
  • (...) + osc2 - sum the signals from the two oscillators together
  • (...) >> filter - pipe the summation output into the filter's input

This may not be worth it; might be somewhat of a dead-end but if the syntax works and is practical in the environments I'm targeting then I don't see why it couldn't be added, especially if the more verbose way is still kept.

Requirements

TBD

Checklist

  • I have linked the correct milestone and/or project(s)
  • I have added the appropriate labels
  • I have assigned this task to the correct people
@maxwellmattryan maxwellmattryan added the type : enhancement Improves an existing feature label Nov 4, 2024
@maxwellmattryan maxwellmattryan added this to the MX - Backlog milestone Nov 4, 2024
@maxwellmattryan maxwellmattryan self-assigned this Nov 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type : enhancement Improves an existing feature
Projects
None yet
Development

No branches or pull requests

1 participant