Skip to content
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
2 changes: 1 addition & 1 deletion .github/workflows/benchmark.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Benchmark

on:
pull_request:
branches: [ "master" ]
branches: [ "master", "dev" ]

env:
CARGO_TERM_COLOR: always
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Build & Test

on:
pull_request:
branches: [ "master" ]
branches: [ "master", "dev" ]

env:
CARGO_TERM_COLOR: always
Expand Down
38 changes: 38 additions & 0 deletions .zed/debug.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
// Project-local debug tasks
//
// For more documentation on how to configure debug tasks,
// see: https://zed.dev/docs/debugger
[
{
"label": "Build & Debug play",
"build": {
"command": "cargo",
"args": [
"build",
"--example",
"play",
"--features=player,fundsp,cpal-output"
]
},
"program": "$ZED_WORKTREE_ROOT/target/debug/examples/play",
"sourceLanguages": ["rust"],
"request": "launch",
"adapter": "CodeLLDB"
},
{
"label": "Build & Debug play-script",
"build": {
"command": "cargo",
"args": [
"build",
"--example",
"play-script",
"--features=scripting,player,cpal-output"
]
},
"program": "$ZED_WORKTREE_ROOT/target/debug/examples/play-script",
"sourceLanguages": ["rust"],
"request": "launch",
"adapter": "CodeLLDB"
}
]
19 changes: 19 additions & 0 deletions .zed/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
// Folder-specific settings
//
// For a full list of overridable settings, and general information on folder-specific settings,
// see the documentation: https://zed.dev/docs/configuring-zed#settings-files
{
"lsp": {
"rust-analyzer": {
"initialization_options": {
"cargo": {
"autoreload": true,
"features": ["scripting", "player", "cpal-output"]
},
"check": {
"command": "clippy"
}
}
}
}
}
23 changes: 23 additions & 0 deletions .zed/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
[
{
"label": "cargo build",
"command": "cargo build --features=scripting,player,cpal-output --example=*",
"show_command": true,
"reveal": "never",
"tags": ["build"]
},
{
"label": "cargo test",
"command": "cargo test --features=scripting,player,cpal-output",
"show_command": true,
"reveal": "never",
"tags": ["test"]
},
{
"label": "cargo clippy",
"command": "cargo clippy --features=scripting,player,cpal-output --example=*",
"show_command": true,
"reveal": "never",
"tags": ["check"]
}
]
9 changes: 4 additions & 5 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,14 @@ mlua = { version = "^0.11", features = [
], optional = true }

# optional -> player
crossbeam-channel = { version = "^0.5", default-features = false, optional = true }
dashmap = { version = "^6.1", optional = true }
phonic = { version = "^0.11", default-features = false, optional = true }
phonic = { version = "^0.12", default-features = false, optional = true }

# dev dependencies
[target.'cfg(not(target_family = "wasm"))'.dev-dependencies]
pretty_assertions = { version = "^1.4" }
notify = { version = "^8.0", default-features = false, features = ["macos_fsevent"] }
ctrlc = { version = "^3.4" }
ctrlc = { version = "^3.5" }
criterion = { version = "^0.7", default-features = false }
simplelog = { version = "^0.12", default-features = false, features = [
"termcolor",
Expand All @@ -63,8 +62,8 @@ debug = "full"
dhat-profiler = ["dhat"]

# example player implementation
player = ["crossbeam-channel", "dashmap", "phonic"]
# example player's audio output driver
player = ["dashmap", "phonic"]
# example player's audio output driver
web-output = ["phonic/web-output"]
cpal-output = ["phonic/cpal-output"]

Expand Down
46 changes: 23 additions & 23 deletions benches/benchmarks/pattern.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ fn create_phrase() -> Phrase {
.unwrap()
.with_mappings(&[
("bd", vec![new_note("c4")]),
("bd2", vec![new_note(("c4", None, 0.5))]),
("bd2", vec![new_note(("c4", None, None, 0.5))]),
]);
let kick_pattern = beat_time.every_nth_beat(16.0).emit(kick_cycle);

Expand Down Expand Up @@ -80,46 +80,46 @@ fn create_phrase() -> Phrase {
.every_nth_eighth(1.0)
.with_rhythm([1, 0, 1, 0, 0, 1, 0, 0, 1, 0, 1, 0, 0, 1, 0, 1].to_rhythm())
.emit(new_note_sequence_emitter(vec![
new_note((bass_notes[0], None, 0.5)),
new_note((bass_notes[2], None, 0.5)),
new_note((bass_notes[3], None, 0.5)),
new_note((bass_notes[0], None, 0.5)),
new_note((bass_notes[2], None, 0.5)),
new_note((bass_notes[3], None, 0.5)),
new_note((bass_notes[6].transposed(-12), None, 0.5)),
new_note((bass_notes[0], None, None, 0.5)),
new_note((bass_notes[2], None, None, 0.5)),
new_note((bass_notes[3], None, None, 0.5)),
new_note((bass_notes[0], None, None, 0.5)),
new_note((bass_notes[2], None, None, 0.5)),
new_note((bass_notes[3], None, None, 0.5)),
new_note((bass_notes[6].transposed(-12), None, None, 0.5)),
]));

let synth_pattern = beat_time
.every_nth_bar(4.0)
.emit(new_polyphonic_note_sequence_emitter(vec![
vec![
new_note(("C 4", None, 0.3)),
new_note(("D#4", None, 0.3)),
new_note(("G 4", None, 0.3)),
new_note(("C 4", None, None, 0.3)),
new_note(("D#4", None, None, 0.3)),
new_note(("G 4", None, None, 0.3)),
],
vec![
new_note(("C 4", None, 0.3)),
new_note(("D#4", None, 0.3)),
new_note(("F 4", None, 0.3)),
new_note(("C 4", None, None, 0.3)),
new_note(("D#4", None, None, 0.3)),
new_note(("F 4", None, None, 0.3)),
],
vec![
new_note(("C 4", None, 0.3)),
new_note(("D#4", None, 0.3)),
new_note(("G 4", None, 0.3)),
new_note(("C 4", None, None, 0.3)),
new_note(("D#4", None, None, 0.3)),
new_note(("G 4", None, None, 0.3)),
],
vec![
new_note(("C 4", None, 0.3)),
new_note(("D#4", None, 0.3)),
new_note(("A#4", None, 0.3)),
new_note(("C 4", None, None, 0.3)),
new_note(("D#4", None, None, 0.3)),
new_note(("A#4", None, None, 0.3)),
],
]));

let fx_pattern = beat_time
.every_nth_seconds(8.0)
.emit(new_polyphonic_note_sequence_emitter(vec![
vec![new_note(("C 4", None, 0.2)), None, None],
vec![None, new_note(("C 4", None, 0.2)), None],
vec![None, None, new_note(("F 4", None, 0.2))],
vec![new_note(("C 4", None, None, 0.2)), None, None],
vec![None, new_note(("C 4", None, None, 0.2)), None],
vec![None, None, new_note(("F 4", None, None, 0.2))],
]));

Phrase::new(
Expand Down
Loading