idk
parent
ca16d2e27e
commit
7b004c8e38
|
@ -261,3 +261,9 @@ issues and prs are welcome, but please open an issue before making any big pr, i
|
||||||
gpl3 or something, i need to check which one to use and the add the correct file
|
gpl3 or something, i need to check which one to use and the add the correct file
|
||||||
|
|
||||||
consider it gpl3 for now
|
consider it gpl3 for now
|
||||||
|
|
||||||
|
## naming
|
||||||
|
|
||||||
|
uhhhh yeah cause the plugins are universal or something, but uni is spelled like annie. also sounds like 언니, which is fun
|
||||||
|
|
||||||
|
the plugins are named very lazily, it's just whatever name i could come up with before creating the crate, so yeah many are not good
|
||||||
|
|
|
@ -9,3 +9,5 @@ crate-type = ["cdylib"]
|
||||||
[dependencies]
|
[dependencies]
|
||||||
baseplug = { git = "https://github.com/wrl/baseplug.git", rev = "9cec68f31cca9c0c7a1448379f75d92bbbc782a8" }
|
baseplug = { git = "https://github.com/wrl/baseplug.git", rev = "9cec68f31cca9c0c7a1448379f75d92bbbc782a8" }
|
||||||
serde = "1.0.126"
|
serde = "1.0.126"
|
||||||
|
|
||||||
|
# utils = { path = "../utils" }
|
||||||
|
|
|
@ -140,7 +140,7 @@ impl Plugin for Sosten {
|
||||||
let idx = self.buffers.idx.min(len - 1);
|
let idx = self.buffers.idx.min(len - 1);
|
||||||
|
|
||||||
// Play from Buffer
|
// Play from Buffer
|
||||||
let (l, r) = self.buffers.read((LEN - len) + idx);
|
let (l, r) = self.buffers.read_at((LEN - len) + idx);
|
||||||
|
|
||||||
output[0][i] = l;
|
output[0][i] = l;
|
||||||
output[1][i] = r;
|
output[1][i] = r;
|
||||||
|
|
|
@ -47,7 +47,12 @@ impl<const LEN: usize> Buffers<LEN> {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn read(&self, idx: usize) -> (f32, f32) {
|
/// Reads buffer, advances idx, returns true if buffer is full
|
||||||
|
pub fn read(&self) -> (f32, f32) {
|
||||||
|
(self.l[self.idx], self.r[self.idx])
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn read_at(&self, idx: usize) -> (f32, f32) {
|
||||||
let idx = idx % LEN;
|
let idx = idx % LEN;
|
||||||
(self.l[idx], self.r[idx])
|
(self.l[idx], self.r[idx])
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue