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

Create Web Assembly bindings for all Signals #30

Open
colinbdclark opened this issue Feb 8, 2022 · 2 comments
Open

Create Web Assembly bindings for all Signals #30

colinbdclark opened this issue Feb 8, 2022 · 2 comments
Labels

Comments

@colinbdclark
Copy link
Contributor

Currently, Web Assembly support is limited to the core functions. The Signals can also be bound, but some research is needed on how to access and use the Emscripten function pointer table from JavaScript.

After that, it should be possible to create bindings that enable all the Signals to be accessed from JavaScript (and thus to run Signaletic in an AudioWorklet).

colinbdclark added a commit to colinbdclark/signaletic that referenced this issue Feb 16, 2022
…sm bindings for several Signals, with example.

This commit temporarily breaks the midiToFreq example and running
the wasm unit tests in Node.js
@colinbdclark colinbdclark changed the title Create Web Assembly bindings for the signals Create Web Assembly bindings for all Signals Feb 22, 2022
@colinbdclark
Copy link
Contributor Author

colinbdclark commented Feb 22, 2022

#21 Added bindings for these Signals:

  • star_sig_Signal
  • star_sig_Sine
  • star_sig_Value
  • star_sig_Gain

We still need bindings for:

  • star_sig_Add
  • star_sig_Invert
  • star_sig_Accumulate
  • star_sig_GatedTimer
  • star_sig_TimedTriggerCounter
  • star_sig_ToggleGate
  • star_sig_OnePole
  • star_sig_Tanh
  • star_sig_Looper

colinbdclark added a commit to colinbdclark/signaletic that referenced this issue Oct 21, 2022
…e signals for now),

which will automatically bind inputs to silence.
lichen-community-systemsgh-30: Updates Web Assembly bindings for more types.
@colinbdclark
Copy link
Contributor Author

There are a handful of situations I haven't been able to figure out how to create workable Emscripten-compatible WebIDL bindings for:

  1. Pointers to void pointers, either as members of an interface or arguments to a function. For example:
struct sig_List {
    void** items;
    size_t capacity;
    size_t length;
};

void sig_List_init(struct sig_List* self, void** items, size_t capacity);
  1. Functions and function pointer members that take arguments to self (in the C sense of the term), such as:
typedef void (*sig_dsp_SignalEvaluator_evaluate)(
    struct sig_dsp_SignalEvaluator* self);

struct sig_dsp_SignalEvaluator {
    sig_dsp_SignalEvaluator_evaluate evaluate;
};

struct sig_dsp_SignalListEvaluator {
    sig_dsp_SignalEvaluator_evaluate evaluate;
    struct sig_List* signalList;

In these cases, I've chosen to omit members and not create bindings for functions.

colinbdclark added a commit to colinbdclark/signaletic that referenced this issue Jul 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant