Skip to content
Snippets Groups Projects
Commit 51133291 authored by David Huss's avatar David Huss :speech_balloon:
Browse files

Add minor corrections

parent c57dd594
Branches
No related tags found
No related merge requests found
......@@ -16,7 +16,7 @@ A matrix mixer allows you to send any input to any number of outputs. Internal c
The pattern for the OSC addresses is as follows: `/chn/1/send/2 <volume>`. This would set the send volume of input `1` to output `2`. The value `<volume>` should be a float, where a value of `0.0` equals -inf dB, `1.0` equals 0 dB and `7.0` equals +18 dB.
The pattern for the OSC addresses is as follows: `/chn/1/send/2 <volume>`. This would set the send volume of input `1` to output `2`. The value `<volume>` should be a float, where a value of `0.0` equals -inf dB, `1.0` equals 0 dB and `8.0` equals roughly +18 dB.
If you are curious how to calculate this: `dB = 20.0 × log10(float)`
......
......@@ -44,13 +44,13 @@ static VOLS16: [AtomicUsize; 16] = arr![AtomicUsize::new(0); 16];
fn main() {
// Receive OSC-Packets at this address
let addr = SocketAddrV4::from_str("127.0.0.1:7011").unwrap();
let addr = SocketAddrV4::from_str("127.0.0.1:7011").expect("Please use a valid IP:Port addr");
let sock = UdpSocket::bind(addr).unwrap();
let mut buf = [0u8; rosc::decoder::MTU];
// Create new jack client (visible e.g. in Catia)
let (client, _status) =
jack::Client::new("Hexmatrix", jack::ClientOptions::NO_START_SERVER).unwrap();
jack::Client::new("Hexmatrix", jack::ClientOptions::NO_START_SERVER).expect("Couldn't connect to jack server. Not running?");
// Open n Jack Input Ports via arr! macro.
let mut i = 0u16;
......@@ -206,7 +206,7 @@ fn process_message(msg: &OscMessage) {
match (maybe_input, maybe_output, maybe_volume) {
(Some(input), Some(output), Some(volume)) => {
println!("ᐅ OSC: Set Volume of Input {} at Output {} to {:.8} ({:.2} dB)", input, output, volume.max(0.0), (20.0* volume.max(0.0).log(10.0)));
println!("ᐅ OSC: Set Volume of Input {} at Output {} to {:.8} ({:.8} dB)", input, output, volume.max(0.0), (20.0* volume.max(0.0).log(10.0)));
match input {
1 => VOLS1[output-1].store((volume * usize::MAX as f32) as usize, Ordering::Relaxed),
2 => VOLS2[output-1].store((volume * usize::MAX as f32) as usize, Ordering::Relaxed),
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment