-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add: Makefile, workflow; fix: README.md
- Loading branch information
1 parent
d098517
commit 07c7e44
Showing
10 changed files
with
153 additions
and
385 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
name: Release Binaries | ||
|
||
on: | ||
release: | ||
types: [created] | ||
|
||
jobs: | ||
build: | ||
strategy: | ||
matrix: | ||
include: | ||
- os: ubuntu-latest | ||
goos: linux | ||
goarch: amd64 | ||
rust_target: x86_64-unknown-linux-gnu | ||
- os: windows-latest | ||
goos: windows | ||
goarch: amd64 | ||
rust_target: x86_64-pc-windows-msvc | ||
- os: macOS-latest | ||
goos: darwin | ||
goarch: amd64 | ||
rust_target: x86_64-apple-darwin | ||
- os: macOS-latest | ||
goos: darwin | ||
goarch: arm64 | ||
rust_target: aarch64-apple-darwin | ||
|
||
runs-on: ${{ matrix.os }} | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Set up Go 1.x | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: ^1.20 | ||
|
||
- name: Set up Rust | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: stable | ||
target: ${{ matrix.rust_target }} | ||
override: true | ||
|
||
- name: Run Makefile | ||
env: | ||
GO111MODULE: on | ||
GOOS: ${{ matrix.goos }} | ||
GOARCH: ${{ matrix.goarch }} | ||
TARGET: ${{ matrix.rust_target }} | ||
EXTENSION: ${{ matrix.goos == 'windows' && '.exe' || '' }} | ||
run: make -f Makefile.ci all | ||
|
||
- name: Archive executables | ||
shell: bash | ||
run: | | ||
if [[ "${{ matrix.goos }}" == "windows" ]]; then | ||
7z a doughscraper_${{ matrix.goos }}_${{ matrix.goarch }}.zip doughscraper.exe | ||
7z a pitchdetector_${{ matrix.goos }}_${{ matrix.goarch }}.zip pitchdetector.exe | ||
else | ||
tar czvf doughscraper_${{ matrix.goos }}_${{ matrix.goarch }}.tar.gz doughscraper | ||
tar czvf pitchdetector_${{ matrix.goos }}_${{ matrix.goarch }}.tar.gz pitchdetector | ||
fi | ||
- name: Upload binaries | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: binaries-${{ matrix.goos }}-${{ matrix.goarch }} | ||
path: | | ||
doughscraper_${{ matrix.goos }}_${{ matrix.goarch }}.tar.gz | ||
pitchdetector_${{ matrix.goos }}-${{ matrix.goarch }}.tar.gz | ||
- name: Upload Release Asset (doughscraper) | ||
uses: actions/[email protected] | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
upload_url: ${{ github.event.release.upload_url }} | ||
asset_path: ./doughscraper_${{ matrix.goos }}_${{ matrix.goarch }}${{ matrix.goos == 'windows' && '.zip' || '.tar.gz' }} | ||
asset_name: doughscraper_${{ matrix.goos }}_${{ matrix.goarch }}${{ matrix.goos == 'windows' && '.zip' || '.tar.gz' }} | ||
asset_content_type: application/gzip | ||
|
||
- name: Upload Release Asset (pitchdetector) | ||
uses: actions/[email protected] | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
upload_url: ${{ github.event.release.upload_url }} | ||
asset_path: ./pitchdetector_${{ matrix.goos }}_${{ matrix.goarch }}${{ matrix.goos == 'windows' && '.zip' || '.tar.gz' }} | ||
asset_name: pitchdetector_${{ matrix.goos }}_${{ matrix.goarch }}${{ matrix.goos == 'windows' && '.zip' || '.tar.gz' }} | ||
asset_content_type: application/gzip |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,6 +7,8 @@ | |
*.dll | ||
*.so | ||
*.dylib | ||
pitchdetector | ||
doughscraper | ||
|
||
# Test binary, built with `go test -c` | ||
*.test | ||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
.PHONY: build_go build_rust | ||
|
||
BINARY_GO := doughscraper | ||
BINARY_RUST := pitchdetector | ||
INSTALL_PATH := /usr/local/bin/ | ||
|
||
build_go: | ||
@echo "Building Go binary" | ||
@cd go && go build -o ../$(BINARY_GO) | ||
|
||
build_rust: | ||
@echo "Building Rust binary" | ||
@cd rust/pitchdetector && cargo build --release | ||
@cp rust/pitchdetector/target/release/$(BINARY_RUST) . | ||
|
||
all: build_go build_rust |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
.PHONY: build_go build_rust install | ||
|
||
BINARY_GO := doughscraper | ||
BINARY_RUST := pitchdetector | ||
|
||
build_go: | ||
@echo "Building Go binary" | ||
cd go && GOOS=$(GOOS) GOARCH=$(GOARCH) go build -o ../$(BINARY_GO)$(EXTENSION) | ||
|
||
build_rust: | ||
@echo "Building Rust binary" | ||
cd rust/pitchdetector && cargo build --release --target $(TARGET) | ||
cp rust/pitchdetector/target/$(TARGET)/release/$(BINARY_RUST)$(EXTENSION) $(BINARY_RUST)$(EXTENSION) | ||
|
||
|
||
all: build_go build_rust |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,25 @@ | ||
# Doughscraper | ||
## Doughscraper | ||
|
||
Doughscraper is a CLI tool for preparing samples for [`tidalcycles/strudel`](https://github.com/tidalcycles/strudel). It has two modes: | ||
- Detect files with note/octave pairs in their names and rename them, removing everything else. This mode is primarily designed to prepare samples generated by Logic Pro's 'Auto Sampler'. | ||
- Take a folder of samples, detect subfolders with pitched samples using their filenames, detect subfolders with one-shot samples, and generate a JSON file for use with strudel. | ||
Doughscraper is a CLI tool for preparing samples for [`tidalcycles/strudel`](https://github.com/tidalcycles/strudel). | ||
|
||
#### Usage | ||
|
||
The first mode requires a path to the local folder with pitched samples: | ||
(e.g., 'Users/username/samples/piano'). | ||
### Usage | ||
Download the latest release for your OS from the release page and put `doughscraper` and `pitchdetector` binaries in your PATH. | ||
|
||
The second mode requires a path to the root of the local samples folder (e.g., 'Users/username/samples') and a path to a remote folder where you will upload your samples (e.g., 'https://raw.githubusercontent.com/vasilymilovidov/samples/main'). | ||
#### Modes: | ||
- **Rename pitched files** — | ||
identifies files with note/octave pairs in their names and renames them by removing everything else. It requires the path to the local folder containing the pitched samples, for example, `Users/username/samples/piano`. | ||
- **Generate JSON** — takes a folder containing samples, identifies subfolders with pitched and oneshot samples based on their filenames. It then generates a JSON file that can be used with strudel. You need to provide the path to the root of the local samples folder (e.g., `'Users/username/samples'`) and the path to a remote folder where you will upload your samples (e.g., `'https://raw.githubusercontent.com/vasilymilovidov/samples/main'`). | ||
- **Detect pitch and rename** — identifies the pitch of the samples and renames them accordingly. It requires the path to the local folder containing the pitched samples, for example, ``Users/username/samples/piano``. Note that this script keeps the original filenames and adds the note/octave pairs to them. So, if you want to properly add these samples to the strudel.json file, run the **Rename pitched files** script first. | ||
|
||
Do not include the closing backslash in the paths. | ||
|
||
#### Build | ||
### Build | ||
To build, you need to have Go and Rust installed. | ||
|
||
Clone the repo and run: | ||
```go | ||
go build | ||
make all | ||
``` | ||
Then copy both generated binaries (`doughscraper` and `pitchdetector`) to your PATH. | ||
|
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains 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
Oops, something went wrong.