Compare commits
2
Commits
392ceceeff
..
v0.2.4
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b53fdd5a6d | ||
|
|
f9f06568bf |
Generated
+1
-1
@@ -320,7 +320,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "galdr"
|
name = "galdr"
|
||||||
version = "0.2.3"
|
version = "0.2.4"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anyhow",
|
"anyhow",
|
||||||
"arc-swap",
|
"arc-swap",
|
||||||
|
|||||||
+2
-2
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "galdr"
|
name = "galdr"
|
||||||
version = "0.2.3"
|
version = "0.2.4"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
description = "A terminal grid synthesizer: signal flows spatially through single-glyph unit generators, voiced by MIDI, rendered low-latency to PipeWire"
|
description = "A terminal grid synthesizer: signal flows spatially through single-glyph unit generators, voiced by MIDI, rendered low-latency to PipeWire"
|
||||||
license = "MIT"
|
license = "MIT"
|
||||||
@@ -11,7 +11,7 @@ codegen-units = 1
|
|||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
anyhow = "1"
|
anyhow = "1"
|
||||||
pipewire = "0.10"
|
pipewire = { version = "0.10", features = ["v0_3_49"] } # Buffer::requested
|
||||||
midir = "0.10"
|
midir = "0.10"
|
||||||
arc-swap = "1.7"
|
arc-swap = "1.7"
|
||||||
rtrb = "0.3"
|
rtrb = "0.3"
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
# Maintainer: Bendik Aagaard Lynghaug <bendik.lynghaug@gmail.com>
|
# Maintainer: Bendik Aagaard Lynghaug <bendik.lynghaug@gmail.com>
|
||||||
pkgname=galdr
|
pkgname=galdr
|
||||||
pkgver=0.2.3
|
pkgver=0.2.4
|
||||||
pkgrel=1
|
pkgrel=1
|
||||||
pkgdesc="Terminal grid synthesizer: signal flows through single-glyph unit generators, MIDI in, low-latency PipeWire out"
|
pkgdesc="Terminal grid synthesizer: signal flows through single-glyph unit generators, MIDI in, low-latency PipeWire out"
|
||||||
arch=('x86_64' 'aarch64')
|
arch=('x86_64' 'aarch64')
|
||||||
|
|||||||
+8
-1
@@ -75,6 +75,7 @@ fn run(
|
|||||||
.add_local_listener_with_user_data(())
|
.add_local_listener_with_user_data(())
|
||||||
.process(move |stream, _| {
|
.process(move |stream, _| {
|
||||||
let Some(mut buffer) = stream.dequeue_buffer() else { return };
|
let Some(mut buffer) = stream.dequeue_buffer() else { return };
|
||||||
|
let requested = buffer.requested() as usize;
|
||||||
let datas = buffer.datas_mut();
|
let datas = buffer.datas_mut();
|
||||||
let Some(data) = datas.first_mut() else { return };
|
let Some(data) = datas.first_mut() else { return };
|
||||||
let stride = ch * 4;
|
let stride = ch * 4;
|
||||||
@@ -85,9 +86,15 @@ fn run(
|
|||||||
engine.apply(ev);
|
engine.apply(ev);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Render only what the graph asked for this cycle. The mapped
|
||||||
|
// buffer is sized by clock.quantum-limit (8192 frames by default),
|
||||||
|
// so filling it whole would do ~32x the work of a 256-frame
|
||||||
|
// quantum and PipeWire would drop everything past the quantum:
|
||||||
|
// choppy output and envelopes that race through their stages.
|
||||||
|
let want = if requested > 0 { requested } else { latency as usize };
|
||||||
let mut n_frames = 0usize;
|
let mut n_frames = 0usize;
|
||||||
if let Some(slice) = data.data() {
|
if let Some(slice) = data.data() {
|
||||||
n_frames = slice.len() / stride;
|
n_frames = want.min(slice.len() / stride);
|
||||||
for f in 0..n_frames {
|
for f in 0..n_frames {
|
||||||
let smp = engine.render(&program);
|
let smp = engine.render(&program);
|
||||||
let bytes = smp.to_le_bytes();
|
let bytes = smp.to_le_bytes();
|
||||||
|
|||||||
@@ -169,7 +169,6 @@ pub fn run(
|
|||||||
KeyCode::Char(c) => {
|
KeyCode::Char(c) => {
|
||||||
grid.set(cx, cy, if c == ' ' { '.' } else { c });
|
grid.set(cx, cy, if c == ' ' { '.' } else { c });
|
||||||
edited = true;
|
edited = true;
|
||||||
cx = (cx + 1).min(grid.w - 1);
|
|
||||||
}
|
}
|
||||||
_ => {}
|
_ => {}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user