fix 'det' parameter of MidiP
This commit is contained in:
parent
a40cc226fd
commit
1d595fe52f
4 changed files with 20 additions and 3 deletions
|
@ -8,6 +8,7 @@ parameter was changed or modulated at runtime.
|
|||
* Bugfix: Found a bug in cubic interpolation in the sample player and
|
||||
similar bugs in the delay line (and all-pass & comb filters). Refactored
|
||||
the cubic interpolation and tested it seperately now.
|
||||
* Change: Moved DSP code over to `synfx-dsp` crate.
|
||||
* Feature: Matrix::get\_connections() returns information about the connections
|
||||
to the adjacent cells.
|
||||
* Feature: Added the MatrixCellChain abstraction for easy creation of DSP
|
||||
|
@ -15,5 +16,4 @@ chains on the hexagonal Matrix.
|
|||
* Feature: Added Scope DSP node and NodeConfigurator/Matrix API for retrieving
|
||||
the scope handles for access to it's capture buffers.
|
||||
* Feature: Added WBlockDSP visual programming language utilizing the `synfx-dsp-jit` crate.
|
||||
* Change: Moved DSP code over to `synfx-dsp` crate.
|
||||
* Feature: Added the `FormFM` node that was contributed by Dimas Leenman (aka Skythedragon).
|
||||
|
|
|
@ -120,6 +120,23 @@ impl MatrixCellChain {
|
|||
self
|
||||
}
|
||||
|
||||
/// Sets the normalized value of the current parameter cell's parameter.
|
||||
///
|
||||
/// The current parameter cell is set automatically when a new node is added.
|
||||
/// Alternatively you can use [MatrixCellChain::params_for_idx] to set the current
|
||||
/// parameter cell.
|
||||
pub fn set_norm(&mut self, param: &str, norm: f32) -> &mut Self {
|
||||
let link = self.chain.get_mut(self.param_idx).expect("Correct parameter idx");
|
||||
|
||||
if let Some(pid) = link.cell.node_id().inp_param(param) {
|
||||
link.params.push((pid, SAtom::param(norm as f32)));
|
||||
} else {
|
||||
self.error = Some(ChainError::UnknownInput(link.cell.node_id(), param.to_string()));
|
||||
}
|
||||
|
||||
self
|
||||
}
|
||||
|
||||
/// Sets the atom value of the current parameter cell's parameter.
|
||||
///
|
||||
/// The current parameter cell is set automatically when a new node is added.
|
||||
|
|
|
@ -112,7 +112,7 @@ impl DspNode for MidiP {
|
|||
let chan = ectx.note_buffer.get_chan_at(channel, frame as u8);
|
||||
|
||||
let note = (chan.note as f32 - 69.0) / 120.0;
|
||||
let note = note + denorm::MidiP::det(det, frame);
|
||||
let note = note + det.read(frame);
|
||||
freq.write(frame, note);
|
||||
|
||||
if chan.gate & 0x10 > 0 {
|
||||
|
|
|
@ -75,7 +75,7 @@ fn check_node_midip_pitch_det() {
|
|||
let mut chain = MatrixCellChain::new(CellDir::B);
|
||||
chain
|
||||
.node_out("midip", "freq")
|
||||
.set_denorm("det", 0.1)
|
||||
.set_norm("det", 0.1)
|
||||
.node_inp("out", "ch1")
|
||||
.place(&mut matrix, 0, 0)
|
||||
.unwrap();
|
||||
|
|
Loading…
Reference in a new issue