Improved top level documentation
This commit is contained in:
parent
ed1ac581ce
commit
ff202ea891
3 changed files with 56 additions and 4 deletions
|
@ -10,3 +10,5 @@ similar bugs in the delay line (and all-pass & comb filters). Refactored
|
|||
the cubic interpolation and tested it seperately now.
|
||||
* Feature: Matrix::get\_connections() returns information about the connections
|
||||
to the adjacent cells.
|
||||
* Feature: Added the MatrixCellChain abstraction for easy creation of DSP
|
||||
chains on the hexagonal Matrix.
|
||||
|
|
29
README.md
29
README.md
|
@ -111,13 +111,16 @@ use hexodsp::*;
|
|||
let (node_conf, mut node_exec) = new_node_engine();
|
||||
let mut matrix = Matrix::new(node_conf, 3, 3);
|
||||
|
||||
|
||||
let sin = NodeId::Sin(0);
|
||||
let amp = NodeId::Amp(0);
|
||||
let out = NodeId::Out(0);
|
||||
matrix.place(0, 0, Cell::empty(sin)
|
||||
.out(None, None, sin.out("sig")));
|
||||
matrix.place(0, 1, Cell::empty(amp)
|
||||
.input(amp.inp("inp"), None, None));
|
||||
.input(amp.inp("inp"), None, None)
|
||||
.out(None, None, amp.out("sig")));
|
||||
matrix.place(0, 2, Cell::empty(out)
|
||||
.input(out.inp("inp"), None, None));
|
||||
matrix.sync().unwrap();
|
||||
|
||||
let gain_p = amp.inp_param("gain").unwrap();
|
||||
|
@ -128,6 +131,28 @@ let (out_l, out_r) = node_exec.test_run(0.11, true);
|
|||
// samples now.
|
||||
```
|
||||
|
||||
There is also a simplified version for easier setup of DSP chains
|
||||
on the hexagonal grid, using the [crate::MatrixCellChain] abstraction:
|
||||
|
||||
```rust
|
||||
use hexodsp::*;
|
||||
|
||||
let (node_conf, mut node_exec) = new_node_engine();
|
||||
let mut matrix = Matrix::new(node_conf, 3, 3);
|
||||
let mut chain = MatrixCellChain::new(CellDir::B);
|
||||
|
||||
chain.node_out("sin", "sig")
|
||||
.node_io("amp", "inp", "sig")
|
||||
.set_atom("gain", SAtom::param(0.25))
|
||||
.node_inp("out", "ch1")
|
||||
.place(&mut matrix, 0, 0);
|
||||
matrix.sync().unwrap();
|
||||
|
||||
let (out_l, out_r) = node_exec.test_run(0.11, true);
|
||||
// out_l and out_r contain two channels of audio
|
||||
// samples now.
|
||||
```
|
||||
|
||||
### State of Development
|
||||
|
||||
As of 2021-05-18: The architecture and it's functionality have been mostly
|
||||
|
|
29
src/lib.rs
29
src/lib.rs
|
@ -113,13 +113,16 @@ use hexodsp::*;
|
|||
let (node_conf, mut node_exec) = new_node_engine();
|
||||
let mut matrix = Matrix::new(node_conf, 3, 3);
|
||||
|
||||
|
||||
let sin = NodeId::Sin(0);
|
||||
let amp = NodeId::Amp(0);
|
||||
let out = NodeId::Out(0);
|
||||
matrix.place(0, 0, Cell::empty(sin)
|
||||
.out(None, None, sin.out("sig")));
|
||||
matrix.place(0, 1, Cell::empty(amp)
|
||||
.input(amp.inp("inp"), None, None));
|
||||
.input(amp.inp("inp"), None, None)
|
||||
.out(None, None, amp.out("sig")));
|
||||
matrix.place(0, 2, Cell::empty(out)
|
||||
.input(out.inp("inp"), None, None));
|
||||
matrix.sync().unwrap();
|
||||
|
||||
let gain_p = amp.inp_param("gain").unwrap();
|
||||
|
@ -130,6 +133,28 @@ let (out_l, out_r) = node_exec.test_run(0.11, true);
|
|||
// samples now.
|
||||
```
|
||||
|
||||
There is also a simplified version for easier setup of DSP chains
|
||||
on the hexagonal grid, using the [crate::MatrixCellChain] abstraction:
|
||||
|
||||
```rust
|
||||
use hexodsp::*;
|
||||
|
||||
let (node_conf, mut node_exec) = new_node_engine();
|
||||
let mut matrix = Matrix::new(node_conf, 3, 3);
|
||||
let mut chain = MatrixCellChain::new(CellDir::B);
|
||||
|
||||
chain.node_out("sin", "sig")
|
||||
.node_io("amp", "inp", "sig")
|
||||
.set_atom("gain", SAtom::param(0.25))
|
||||
.node_inp("out", "ch1")
|
||||
.place(&mut matrix, 0, 0);
|
||||
matrix.sync().unwrap();
|
||||
|
||||
let (out_l, out_r) = node_exec.test_run(0.11, true);
|
||||
// out_l and out_r contain two channels of audio
|
||||
// samples now.
|
||||
```
|
||||
|
||||
## State of Development
|
||||
|
||||
As of 2021-05-18: The architecture and it's functionality have been mostly
|
||||
|
|
Loading…
Reference in a new issue