Add ReScript bindings for Tone.js audio library#1
Closed
Conversation
Initialize rescript-tonejs project with ReScript v12, Vite, Tone.js, and zekr for testing. Set up directory structure, build configuration, and verify compilation and test runner work.
Add ReScript bindings for the core Tone.js API: - Types module with time, frequency, and unit types - Tone module (start, now, getContext, getTransport, getDestination) - Context (now, immediate, sampleRate, lookAhead) - Transport (start/stop/pause, scheduling, BPM, position, loop) - Destination (volume, mute) - Param (value get/set, ramp methods) - AudioNode (connect, disconnect, toDestination, chain, fan, dispose) Includes 17 tests covering runtime behavior and compile-time binding verification.
Add ReScript bindings for Tone.js instruments and sources: - Synth, AMSynth, FMSynth, MonoSynth, PolySynth (instruments) - Oscillator, Player, Noise (sources) - Shared envelope, oscillator, and filter option types in Types module Each module exposes constructors, trigger methods, properties, and AudioNode casting. Includes 8 test suites verifying binding correctness.
Add ReScript bindings for Tone.js effects and audio components: - Effects: Reverb, FeedbackDelay, Chorus, Distortion, AutoFilter, AutoPanner, AutoWah, BitCrusher, Chebyshev, Freeverb, JCReverb, Phaser, PingPongDelay, PitchShift, Tremolo, Vibrato, FrequencyShifter, StereoWidener - Components: Compressor, Limiter, Gate, Filter, EQ3, Panner Each module includes constructors, property accessors, and AudioNode casting. Includes 24 test suites verifying binding correctness.
Add ReScript bindings for Tone.js signal and channel modules: - Signal (schedulable audio signal with ramp/automation methods) - Volume (volume control with mute) - Gain (basic gain node) - Channel (routing with pan, volume, solo, mute, send/receive) - CrossFade (crossfade between two inputs) Includes 5 test suites verifying binding correctness.
Add ReScript bindings for Tone.js scheduling modules: - Loop (looping callback with interval, iterations, probability) - Event (schedulable event with loop and playback control) - Part (collection of events on a timeline) - Sequence (ordered series of events with subdivision) Each module exposes constructors, start/stop/cancel, and properties for loop, playbackRate, probability, humanize, and mute. Includes 4 test suites verifying binding correctness.
Configure semantic-release for automated versioning and changelog generation based on conventional commits. Add GitHub Actions CI workflow that runs tests on PRs and triggers releases on main.
Add README.md with installation, quick start, and usage examples. Add docs/API.md with comprehensive API reference for all modules. Rename package from rescript-tonejs to rescript-tone across all configs.
69e0680 to
9e7ed87
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR introduces comprehensive ReScript bindings for Tone.js, a Web Audio API framework for creating interactive music in the browser.
Summary
Complete type-safe ReScript bindings for Tone.js v15, enabling developers to use Tone.js functionality with full type checking and IDE support in ReScript projects.
Key Changes
Core Bindings
ToneJs_Types.res): Comprehensive type aliases for Tone.js units (time, frequency, decibels, etc.) and enums (oscillator types, playback states, etc.)ToneJs.res): Central entry point re-exporting all Tone.js modulesInstruments & Synthesizers
Sources
Effects (20+ effects)
Signal Processing
Scheduling & Events
Testing
Build & CI/CD
Implementation Details
@module("tone")to import from the Tone.js npm package~syntax for named arguments@get/@setattributes