-
-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
support for VU meter values #139
Conversation
☁️ Nx Cloud ReportCI is running/has finished running commands for commit c5c2235. As they complete they will appear below. Click to see the status, the terminal output, and the build insights. 📂 See all runs for this CI Pipeline Execution ✅ Successfully ran 2 targetsSent with 💌 from NxCloud. |
@yleguern64 Can you please review this, especially the API surface? |
091f648
to
25f0d18
Compare
I'm going to test that, and I'll reply soon for confirmation or add code for changes. Thank you for this great feature ! |
For me, everything works perfectly ! Thank you. try {
mixer = new SoundcraftUI(config.mixer.ip);
await mixer.connect();
} catch (e) {
console.log(`Cannot connect to mixer : ${e}`);
process.exit(-1);
}
const modulo = 50;
let iModuloL = 0;
let iModuloR = 0;
mixer.vuProcessor.line(1).subscribe(value => {
if (iModuloL % modulo === 0) {
const v = Math.round(value.vuPost * 10000) / 100;
if (v > 3 || v === 0) {
console.log("L : " + v);
}
}
iModuloL++;
});
mixer.vuProcessor.line(2).subscribe(value => {
if (iModuloR % modulo === 0) {
const v = Math.round(value.vuPost * 10000) / 100;
if (v > 3 || v === 0) {
console.log("R : " + v);
}
}
iModuloR++;
}); |
Great job ! Next step ;) Merge to main and tag 👍 |
This PR adds support for VU information.
Discussion points
Docs (from the README)
Volume levels can be consumed through the
VuProcessor
class, fully separated from theMasterChannel
class.The VU information is published through streams, separated by channel.
Please be aware that only channels on the master bus are available.
VuProcessor
master()
input(2)
line(1)
player(1)
aux(2)
fx(3)
sub(3)
Each of the method calls directly returns an Observable that can be subscribed to.
The streams emit objects with different VU values.
They are always published as linear values between
0
and1
.The
vuPre
field is only available on input channels (input, player and line).Master, FX and Sub groups publish stereo information, so the object is structured as follows:
Processing of the VU information happens lazily: VU messages from the mixer are ignored until the first VU stream is subscribed to. The messages are only processed if VU information is actually consumed.
All channels
The
vuData$
field onVuProcessor
publishes a raw object with all channel VU information available.This can be used to process all information at once, e.g. for a VU meter dashboard across all channels.
VU values in dB
All VU values are linear values between
0
and1
. To express the level in dB you need to project the value to the dB range of the meter (-80..0 dB
).The exported utility function
vuValueToDB()
helps with that task and can be used as follows: