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

extra null check on diff #12

Closed
wants to merge 14 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
68 changes: 0 additions & 68 deletions .github/workflows/main.yml

This file was deleted.

1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ pnpm-debug.log*
lerna-debug.log*

# Builds
native
node_modules
build
dist
Expand Down
3 changes: 2 additions & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@
url = https://github.com/juce-framework/JUCE.git
[submodule "choc"]
path = native/choc
url = https://github.com/nick-thompson/choc.git
url = https://github.com/cristianvogel/choc
branch = cristians-edits
94 changes: 1 addition & 93 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,93 +1 @@
# SRVB

SRVB is a small digital reverb audio plugin (VST3/AU) for MacOS and Windows.

This project demonstrates one way to write an audio plugin using JavaScript and
familiar web technologies, and while there are several variants on this approach,
it is meant to be both a compelling example and a good starting point for audio
plugins made with a similar architecture.

## Overview

The software architecture in this plugin is much like [Tauri](https://tauri.app/) and similar to
[Electron](https://www.electronjs.org/). The user interface is a simple Vite, React, and Tailwind app
at the root of the repository, which is packaged into the plugin app bundle and loaded into a native
webview instance owned by the plugin at runtime.

The audio processing algorithm in the `dsp/` directory is also written in
JavaScript using [Elementary](https://elementary.audio), and is run in a separate
engine which directs the underlying native plugin audio processing. The native
plugin itself provides the harness for these two frontend JavaScript bundles,
and interfaces with the plugin host (typically a DAW) to coordinate the user
interface and the audio processing loop.

## Elementary

If you're new to Elementary Audio, [Elementary](https://elementary.audio) is a JavaScript/C++ library for building audio applications.

* **Declarative:** Elementary makes it simple to create interactive audio processes through functional, declarative programming. Describe your audio process as a function of your application state, and Elementary will efficiently update the underlying audio engine as necessary.
* **Dynamic:** Most audio processing frameworks and tools facilitate building static processes. But what happens as your audio requirements change throughout the user journey? Elementary is designed to facilitate and adapt to the dynamic nature of modern audio applications.
* **Portable:** By decoupling the JavaScript API from the underlying audio engine (the "what" from the "how"), Elementary enables writing portable applications. Whether the underlying engine is running in the browser, an audio plugin, or an embedded device, the JavaScript layer remains the same.

Find more in the [Elementary repository on GitHub](https://github.com/elemaudio/elementary) and the documentation [on the website](https://elementary.audio/).

## Getting Started

### Dependencies

Before running the following steps, please make sure you have the following dependencies installed and
available at the command line:

* [CMake](https://cmake.org/)
* [Node.js](https://nodejs.org/en)
* Bash: the build steps below expect to run scripts in a Bash environment. For Windows machines, consider running the following steps in a Git Bash environment, or with WSL.

Next, we fetch the SRVB project and its dependencies,

```bash
# Clone the project with its submodules
git clone --recurse-submodules https://github.com/elemaudio/srvb.git
cd srvb

# Install npm dependencies
npm install
```

### Develop
```bash
npm run dev
```

In develop mode, the native plugin is compiled to fetch its JavaScript assets from localhost, where subsequently we
run the Vite dev server to serve those assets. This arrangement enables Vite's hot reloading behavior for developing
the plugin while it's running inside a host.

### Release
```bash
npm run build
```

In release builds, the JavaScript bundles are packaged into the plugin app bundle so that the resulting bundle
is relocatable, thereby enabling distribution to end users.

### Troubleshooting

* After a successful build with either `npm run dev` or `npm run build`, you
should have local plugin binaries built and copied into the correct
audio plugin directories on your machine. If you don't see them, look in
`./native/build/scripted/SRVB_artefacts` and copy them manually
* **Note**: the CMake build on Windows attempts to copy the VST3 plugin binary
into `C:\Program Files`, a step that requires admin permissions. Therefore
you should either run your build as an admin, or disable the copy plugin step
in `native/CMakeLists.txt` and manually copy the plugin binary after build.
* **Note**: especially on MacOS, certain plugin hosts such as Ableton Live have
strict security settings that prevent them from recognizing local unsigned
binaries. You'll want to either add a codesign step to your build, or
configure the security settings of your host to address this.

## License

[MIT](./LICENSE.md)

This project also uses [JUCE](https://juce.com/), which is licensed GPLv3. Please consult JUCE's license
agreement if you intend to distribute your own plugin based on this template.
# Under construction
3 changes: 1 addition & 2 deletions dsp/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import {Renderer, el} from '@elemaudio/core';
import {RefMap} from './RefMap';
import srvb from './srvb';


// This project demonstrates writing a small FDN reverb effect in Elementary.
//
// First, we initialize a custom Renderer instance that marshals our instruction
Expand All @@ -20,7 +19,7 @@ let refs = new RefMap(core);
let prevState = null;

function shouldRender(prevState, nextState) {
return (prevState === null) || (prevState.sampleRate !== nextState.sampleRate);
return (prevState === null) || (nextState ===null) || (prevState.sampleRate !== nextState.sampleRate);
}

// The important piece: here we register a state change callback with the native
Expand Down
166 changes: 166 additions & 0 deletions how_to_update_choc.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,166 @@
Important to update CHOC that is used in the native/choc submodule and also probably in Elementary submodule

here is copilot guide.


cristianvogel: npm command to install everything including git submodules

GitHub Copilot: ```bash
npm install && git submodule update --init --recursive
```
cristianvogel: remove all cache of git submodules
GitHub Copilot: ```bash
git submodule deinit -f --all && git rm -rf .git/modules
```

cristianvogel: fatal: No url found for submodule path 'native/choc' in .gitmodules


There is no url registred in .gitmodules file

GitHub Copilot: To resolve the issue of a missing URL for the submodule path 'native/choc' in the [`.gitmodules`](command:_github.copilot.openRelativePath?%5B%7B%22scheme%22%3A%22file%22%2C%22authority%22%3A%22%22%2C%22path%22%3A%22%2FUsers%2Fcristianvogel%2FDesktop%2FProgramming%2FSRVB-withCablesUI%2Fsrvb-fork%2F.gitmodules%22%2C%22query%22%3A%22%22%2C%22fragment%22%3A%22%22%7D%5D "/Users/cristianvogel/Desktop/Programming/SRVB-withCablesUI/srvb-fork/.gitmodules") file, you need to add the submodule information for 'native/choc' to the [`.gitmodules`](command:_github.copilot.openRelativePath?%5B%7B%22scheme%22%3A%22file%22%2C%22authority%22%3A%22%22%2C%22path%22%3A%22%2FUsers%2Fcristianvogel%2FDesktop%2FProgramming%2FSRVB-withCablesUI%2Fsrvb-fork%2F.gitmodules%22%2C%22query%22%3A%22%22%2C%22fragment%22%3A%22%22%7D%5D "/Users/cristianvogel/Desktop/Programming/SRVB-withCablesUI/srvb-fork/.gitmodules") file. This involves specifying the path and URL of the submodule. Here's how you can do it:

1. Open the [`.gitmodules`](command:_github.copilot.openRelativePath?%5B%7B%22scheme%22%3A%22file%22%2C%22authority%22%3A%22%22%2C%22path%22%3A%22%2FUsers%2Fcristianvogel%2FDesktop%2FProgramming%2FSRVB-withCablesUI%2Fsrvb-fork%2F.gitmodules%22%2C%22query%22%3A%22%22%2C%22fragment%22%3A%22%22%7D%5D "/Users/cristianvogel/Desktop/Programming/SRVB-withCablesUI/srvb-fork/.gitmodules") file in your editor.
2. Add the following lines to register the 'native/choc' submodule:

```properties
[submodule "choc"]
path = native/choc
url = <URL_TO_CHOC_GIT_REPOSITORY>
```

Replace `<URL_TO_CHOC_GIT_REPOSITORY>` with the actual URL of the 'choc' Git repository.

3. Save the `.gitmodules` file.
4. Run the following commands in your terminal to synchronize your local configuration:

```bash
git submodule init
git submodule update
```

This will initialize the new submodule and clone it into the specified path.

cristianvogel: i am trying to remove this submodule referenence but it dosn't seem to de-install

GitHub Copilot: To remove a submodule reference, such as `elementary` or `juce`, from your Git repository, you need to follow these steps. Let's use `elementary` as an example:

1. **Delete the submodule entry from [`.gitmodules`](command:_github.copilot.openRelativePath?%5B%7B%22scheme%22%3A%22file%22%2C%22authority%22%3A%22%22%2C%22path%22%3A%22%2FUsers%2Fcristianvogel%2FDesktop%2FProgramming%2FSRVB-withCablesUI%2Fsrvb-fork%2F.gitmodules%22%2C%22query%22%3A%22%22%2C%22fragment%22%3A%22%22%7D%5D "/Users/cristianvogel/Desktop/Programming/SRVB-withCablesUI/srvb-fork/.gitmodules") file**: Open the [`.gitmodules`](command:_github.copilot.openRelativePath?%5B%7B%22scheme%22%3A%22file%22%2C%22authority%22%3A%22%22%2C%22path%22%3A%22%2FUsers%2Fcristianvogel%2FDesktop%2FProgramming%2FSRVB-withCablesUI%2Fsrvb-fork%2F.gitmodules%22%2C%22query%22%3A%22%22%2C%22fragment%22%3A%22%22%7D%5D "/Users/cristianvogel/Desktop/Programming/SRVB-withCablesUI/srvb-fork/.gitmodules") file and remove the section related to `elementary`.

```properties
[submodule "elementary"]
path = native/elementary
url = https://github.com/elemaudio/elementary.git
```

2. **Stage the `.gitmodules` changes**: After editing the `.gitmodules` file, stage the changes for commit.

```bash
git add .gitmodules
```

3. **Delete the submodule section from [`.git/config`](command:_github.copilot.openRelativePath?%5B%7B%22scheme%22%3A%22file%22%2C%22authority%22%3A%22%22%2C%22path%22%3A%22%2FUsers%2Fcristianvogel%2FDesktop%2FProgramming%2FSRVB-withCablesUI%2Fsrvb-fork%2F.git%2Fconfig%22%2C%22query%22%3A%22%22%2C%22fragment%22%3A%22%22%7D%5D "/Users/cristianvogel/Desktop/Programming/SRVB-withCablesUI/srvb-fork/.git/config")**: Open your [`.git/config`](command:_github.copilot.openRelativePath?%5B%7B%22scheme%22%3A%22file%22%2C%22authority%22%3A%22%22%2C%22path%22%3A%22%2FUsers%2Fcristianvogel%2FDesktop%2FProgramming%2FSRVB-withCablesUI%2Fsrvb-fork%2F.git%2Fconfig%22%2C%22query%22%3A%22%22%2C%22fragment%22%3A%22%22%7D%5D "/Users/cristianvogel/Desktop/Programming/SRVB-withCablesUI/srvb-fork/.git/config") file in a text editor and remove the submodule section related to `elementary`.

```ini
[submodule "elementary"]
url = https://github.com/elemaudio/elementary.git
```

4. **Unstage and remove the submodule files**: Run the following commands to unstage the submodule path and then remove the submodule directory from your working directory.

```bash
git rm --cached native/elementary
rm -rf native/elementary
```

5. **Remove the submodule's [`.git`](command:_github.copilot.openRelativePath?%5B%7B%22scheme%22%3A%22file%22%2C%22authority%22%3A%22%22%2C%22path%22%3A%22%2FUsers%2Fcristianvogel%2FDesktop%2FProgramming%2FSRVB-withCablesUI%2Fsrvb-fork%2F.git%22%2C%22query%22%3A%22%22%2C%22fragment%22%3A%22%22%7D%5D "/Users/cristianvogel/Desktop/Programming/SRVB-withCablesUI/srvb-fork/.git") directory**: Delete the [`.git`](command:_github.copilot.openRelativePath?%5B%7B%22scheme%22%3A%22file%22%2C%22authority%22%3A%22%22%2C%22path%22%3A%22%2FUsers%2Fcristianvogel%2FDesktop%2FProgramming%2FSRVB-withCablesUI%2Fsrvb-fork%2F.git%22%2C%22query%22%3A%22%22%2C%22fragment%22%3A%22%22%7D%5D "/Users/cristianvogel/Desktop/Programming/SRVB-withCablesUI/srvb-fork/.git") directory located in the submodule's directory. Since you've already removed the directory in the previous step, this is more of a general step if you need to manually remove any leftover [`.git`](command:_github.copilot.openRelativePath?%5B%7B%22scheme%22%3A%22file%22%2C%22authority%22%3A%22%22%2C%22path%22%3A%22%2FUsers%2Fcristianvogel%2FDesktop%2FProgramming%2FSRVB-withCablesUI%2Fsrvb-fork%2F.git%22%2C%22query%22%3A%22%22%2C%22fragment%22%3A%22%22%7D%5D "/Users/cristianvogel/Desktop/Programming/SRVB-withCablesUI/srvb-fork/.git") directories.

6. **Commit your changes**: Commit the removal of the submodule.

```bash
git commit -m "Removed elementary submodule"
```

7. **Delete the submodule's entry from the `.git/modules` directory**: Finally, remove the submodule's data from the `.git/modules` directory.

```bash
rm -rf .git/modules/native/elementary
```

Repeat these steps for any other submodule you wish to remove, such as `juce`. Make sure to adjust the paths and names accordingly.

cristianvogel: how do i specifiy a specific branch and commit for a submodule

GitHub Copilot: To specify a specific branch and commit for a submodule in Git, follow these steps:

1. **Navigate to the submodule directory**: First, change your current working directory to the submodule's directory.
```bash
cd path/to/submodule
```
Replace `path/to/submodule` with the actual path to your submodule, such as `native/elementary`.
2. **Checkout the specific branch**: Checkout the branch you want to track in the submodule.
```bash
git checkout branch-name
```
Replace `branch-name` with the name of the branch you want to use.
3. **Pull or reset to the specific commit**: If you want the latest commit from that branch, you can simply pull. However, if you need a specific commit, use `git reset` or `git checkout` to move to that commit.
- To pull the latest changes (if you're tracking a branch):

```bash
git pull
```

- To move to a specific commit:

```bash
git reset --hard commit-hash
```

or

```bash
git checkout commit-hash
```

Replace `commit-hash` with the hash of the commit you want to use.

4. **Update the submodule reference in the main project**: After you have checked out the specific branch and commit in the submodule, navigate back to the root of your main project and stage the submodule changes.

```bash
cd ../..
git add path/to/submodule
```

This adds the new state of the submodule to your main project.

5. **Commit the change**: Commit the update to the submodule reference in your main project.

```bash
git commit -m "Update submodule to specific branch and commit"
```

6. **(Optional) Push the changes**: If you want these changes to be reflected in the remote repository, push them.

```bash
git push
```

**Note**: If you want to ensure that the submodule is always checked out to a specific branch when others clone or pull from the main repository, you can add the `branch` option to the [`.gitmodules`](command:_github.copilot.openRelativePath?%5B%7B%22scheme%22%3A%22file%22%2C%22authority%22%3A%22%22%2C%22path%22%3A%22%2FUsers%2Fcristianvogel%2FDesktop%2FProgramming%2FSRVB-withCablesUI%2Fsrvb-fork%2F.gitmodules%22%2C%22query%22%3A%22%22%2C%22fragment%22%3A%22%22%7D%5D "/Users/cristianvogel/Desktop/Programming/SRVB-withCablesUI/srvb-fork/.gitmodules") file. This doesn't lock the submodule to a specific commit but ensures the specified branch is checked out.
```properties
[submodule "submodule-name"]
path = path/to/submodule
url = https://example.com/submodule.git
branch = branch-name
```
Replace `submodule-name`, `path/to/submodule`, `https://example.com/submodule.git`, and `branch-name` with your submodule's name, path, URL, and branch name, respectively. After adding the branch to `.gitmodules`, remember to commit and push the `.gitmodules` file as well.
Loading