{"id":16835347,"url":"https://github.com/defuse/dawr","last_synced_at":"2025-03-22T04:30:51.595Z","repository":{"id":57616533,"uuid":"131958355","full_name":"defuse/DAWr","owner":"defuse","description":"The start of a library for building a DAW and/or sound experiments in Rust","archived":false,"fork":false,"pushed_at":"2019-04-29T07:02:29.000Z","size":3900,"stargazers_count":26,"open_issues_count":10,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-18T08:11:18.159Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/defuse.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-05-03T07:31:44.000Z","updated_at":"2024-07-20T13:24:24.000Z","dependencies_parsed_at":"2022-08-27T08:22:10.066Z","dependency_job_id":null,"html_url":"https://github.com/defuse/DAWr","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/defuse%2FDAWr","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/defuse%2FDAWr/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/defuse%2FDAWr/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/defuse%2FDAWr/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/defuse","download_url":"https://codeload.github.com/defuse/DAWr/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244907420,"owners_count":20529850,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-13T12:09:48.385Z","updated_at":"2025-03-22T04:30:50.938Z","avatar_url":"https://github.com/defuse.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# DAWr\n\n[![Build Status](https://travis-ci.org/defuse/DAWr.svg?branch=master)](https://travis-ci.org/defuse/DAWr)\n[![crates.io](https://img.shields.io/crates/v/dawr.svg)](https://crates.io/crates/dawr)\n\nDAWr (pronounced \"door\") is an audio playground for people who like to write\nRust code. It has some features of a simple DAW, including a build-in wavetable\nsynthesizer, sampler, and basic audio effects. However, it's still missing\na lot: there's no equalizer, the sampler only works in one-shot mode, and more.\nI don't plan on adding new features for the time being, but I'd appreciate\nsuggestions and pull requests!\n\nThe feature set is limited, but it's enough to make a shitty future bass drop\nsection in Rust! You can find code for this in\n[src/bin/demotrack.rs](src/bin/demotrack.rs). Here's what it [sounds like (on\nSoundCloud)](https://soundcloud.com/earthrise5/dawr-library-example).\n\n**WARNING:** This library doesn't have any unit tests! There are probably bugs!\n\n## Devices\n\nIn this library, devices are things that emit a signal, which can either be mono\nor stereo. Stereo is usually audio, and mono is usually some kind of control\nparameter. There are two important traits, `MonoEmitter` and `StereoEmitter` for\ndevices which output mono or stereo respectively. There is also an `EventSource`\ntype representing a collection of events that occur at specific moments in time\n(e.g. `NoteOn(frequency)` and `NoteOff`). The philosophy is that each device\nshould do one simple thing well, and then more powerful devices can be created\nby chaining simpler ones.\n\nNew devices are constructed by providing references to all of their input\ndevices and references to all of the event sources they need to listen to. For\nexample, to build the `MonoSynth` device, it needs to be provided references to\nan `Oscillator` (a `MonoEmitter` which tells it what its current phase in the\nwave is), another `MonoEmitter` to tell it which wave of the wavetable is\nselected at the current moment in time, and another `MonoEmitter` specifying the\namplitude envelope. In order to get notes to play, the amp envelope device will\nlisten to an `EventSource\u003cNoteEvent\u003e` and output a non-zero amplitude value\nduring the notes. We use Rust's `Rc` pointers extensively, so multiple devices\ncan use the same device as input.\n\nHere is a list of all the built-in devices:\n\n### Mono Sources\n\n- `ConstSignal`: Outputs a constant-valued mono signal.\n- `Envelope`: Listens for `NoteOn` events and outputs 0.0 when there are no notes\n  playing and 1.0 while a note is playing.\n- `Oscillator`: For use with `MonoSynth`, outputs the current phase of the wave\n  being played.\n\n### Instruments\n\n- `MonoSynth`: A monophonic wavetable synthesizer. You can create polyphony and\n  unison by using more than one instance along with the `Pan` effect and the\n  `MonoSynth`'s `Oscillator`'s detune parameter.\n\n- `Sampler`: Listens to an `EventSource\u003cSamplerEvent\u003e` and plays some audio\n  whenever it sees a `Play` or `PlayAtSpeed(speed)` event. In the latter case,\n  the playback is sped up by a factor of `speed` (by skipping over or\n  duplicating samples).\n\n### Effects\n\n- `Mixer`: Sums the outputs of multiple stereo inputs.\n- `Gain`: Multiplies a stereo input signal with a mono input signal.\n- `Pan`: Adjusts the balance of a stereo signal according to a mono input signal\n  in the range [-1, 1].\n- `MonoToStereo`: Duplicates a mono signal to both channels of a stereo signal.\n- `StereoToMono`: Sums the left and right channels of a stereo input to create\n  a mono signal.\n- `WaveShaperEffect`: Applies waveshaping (e.g. hard clipping) to a stereo\n  signal.\n\n## Wishlist\n\nThis library is missing some really important stuff, like:\n\n- High-pass and low-pass filters.\n- An equalizer.\n- MIDI support.\n- A polyphonic synth device that listens to MIDI events, based on `MonoSynth`.\n- Unit tests.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdefuse%2Fdawr","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdefuse%2Fdawr","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdefuse%2Fdawr/lists"}