DAW14: Deciphering State Management in Tauri
Through trial and error, I discover how Tauri manages state - and how NOT to manage state in Rust (using mutable global variables).
Through trial and error, I discover how Tauri manages state - and how NOT to manage state in Rust (using mutable global variables).
Along with a number of other little fixes, we find three ways to create a new window in Tauri. This lets us launch a new "editor" window after the "open project" window has done its job.
Wow, who knew how easy it was to pick files using Tauri! Not only do we pick a file, but we pick a plaintext-daw song file AND invoke Python from Tauri, all in just a few lines of code.
In this video, we generate a Tauri project and get it running. Nothing crazy, we just add a new button to print something to the console. Also, a look at the roadmap, what's next, and how Tauri can interact with our existing Python CLI.
At last, we've finished refactoring all the code into a single, well-tested ResourceManager class and updated the CLI to call this new code. All tests are passing; we have some new code debt, but that's okay for now.
In this video, we use patch.object to test that other methods in the class are called while keeping the test scoped to a single unit - true unit tests!
We also continue to apply Test Driven Development (TDD) to create our ResourceManager class, which will serve as a great foundation for the application when it's complete.
In this video, we review/merge some PRs, then get started implementing a new architecture. The first order of business is to add a ResourceManager to handle all the complex things we do to load wav/mp3 files and generate sounds using our Synth.
This video is a wild goose chase to figure out why I can't seem to calculate the start/end sample of notes properly.
In this video, we merge LTstrange's awesome synth MR and get the main CLI tool to generate music from nothing but the numpy sine function.
In this video, we fix BPM calculation, write a ton of messy code, and end up loading some piano samples from a remote Git repository.
Also, I show how to translate note pitch in Audacity.