Managed to setup a simple gain between audio input and output so far. LOL
Now I would like to visualize the resulting audio level by implementing a stereo peak meter with dBFS scale. (The provided meters.csd is instead featuring random values.)
I know, this may be VERY “CSound noobish” to ask:
But how do I “feed” the respective two channels, which I’d like to visualize, into the meter?!?
It doesn’t seem to be enough to connect them via the patcher.
Please forgive me my lack of knowledge(!).
At the moment my knowledge of CSound is too little to accomplish this task.
But I am willing to learn!
Thx Rory! That one could be fine.
I only don’t know how to exchange the meter’s oscillator input for the input of the elements input-node.
There is a “slider-style” meter from this forum, which I brought up and running.
But I would love to have a “real” meter display instead of a moving slider.
</Cabbage>
<CsoundSynthesizer>
<CsOptions>
-n -d -+rtmidi=NULL -M0 -m0d
</CsOptions>
<CsInstruments>
; Initialize the global variables.
sr = 44100
ksmps = 8
nchnls = 2
0dbfs = 1
instr 1
aInL inch 1
krms rms aInL ; scan rms
kdb = dbfsamp(krms) ; convert to db
kpeak init -90 ; initialise peak value
if metro(0.5)==1 then ; reset peak hold
kpeak = -90
endif
kpeak = kdb>kpeak?kdb:kpeak ; compare stored peak value with current db value
kpeakP port kpeak, 0.25 ; smooth changes of peak value
if metro(16)==1 then ; peg update of widgets
chnset kdb,"meterL"
endif
endin
</CsInstruments>
<CsScore>
;causes Csound to run for about 7000 years...
f0 z
;starts instrument 1 and runs it for a week
i1 0 [60*60*24*7]
</CsScore>
</CsoundSynthesizer>
Managed to set up an input stage w/ gain adjustment and metering,
followed by an output stage w/ gain adjustment and metering so far.
In the next step I’ll try to implement a highcut filter in a parallel path, including a wet/dry adjustment.
I’m so excited to see this thing slooooowly grow into my very first plugin. ^^
Cabbage is really fun to play around with and such a smart tool, even for a total newbie. Love it!
Cool. I hadn’t come across KRETS before. I must give it a shot. The reason I asked is because I’m notoriously bad at promoting Cabbage, so I’m always pleasantly surprised when people stumble across it!
I don’t think any of the examples make use of a VU meter. When so many hosts provide vu metres for each plugin it doesn’t seem important. But you got yours to work right?
Unfortunately, if I combine your code with the images provided, and feed it with audio … there is only the first image displayed and no image swapping takes place (see attached ZIP file). VU_meter_test.zip (218.0 KB)
That’s fantastic. Rory. It works!
Thank you SO much.
Only thing strange is, that as soon as I amplify the level of a white noise test-signal above +5.5 dBFS the VU meter graphic starts flickering and fully disappears, if I exceed a gain of about +6 dBFS.
I guess, the .csd runs out of PNG image portions. ^^
A solution could be to add enough image parts at the “end” of the PNG file to match the highest RMS value to be displayed.
Or is there any way to keep the VU meter showing the last part of the PNG, no matter how high the RMS value? e.g. some possibility to “cap” the incoming RMS value for the VU meter?
P.S.:
NEVERMIND
I found out how to adjust the “translation” of the RMS value into the VU meter display.