VuMeter

44 views
Skip to first unread message

Tristan SABOURIN

unread,
Aug 6, 2021, 5:13:20 AM8/6/21
to pyo-discuss
Hello ! 
What is the function to display the value of a signal on a vumeter ?

I tried something like this : 
a = Input()
...
...
b.out()
c = RMS(b)
d = c.get()
vm = PyoGuiVuMeter(my_panel), nchnls=2)
vm.display(d)

But it doesn't work, vumeter is displayed on my wxPython window, but not the signal.

Thanks a lot

Tristan SABOURIN

unread,
Aug 13, 2021, 4:01:39 AM8/13/21
to pyo-discuss
Nobody can help me ? :(

Olivier Bélanger

unread,
Aug 13, 2021, 3:35:23 PM8/13/21
to pyo-d...@googlegroups.com
Hi Tristan,

Take a look in this code how the setRms() function of the PyoGuiVuMeter is bounded to an RMS object:

from pyo import *

s = Server().boot().start()

audioInputs = Input([0,1])
audioRMS = RMS(audioInputs)

class MyFrame(wx.Frame):
def __init__(self, parent, id=-1, title="Frame Title", pos=(25,25), size=(500,400)):
wx.Frame.__init__(self, parent, id, title, pos, size)
self.panel = wx.Panel(self)
self.box = wx.BoxSizer(wx.VERTICAL)

self.vm = PyoGuiVuMeter(self.panel, nchnls=2)
audioRMS.setFunction(self.vm.setRms)

self.panel.SetSizer(self.box)
self.Show()

app = wx.App()
f = MyFrame(None)
app.MainLoop()


Olivier





521 rue Geo
rges Méliès
L'@ltis - 3ème étage
34000 MONTPELLIER

Tel : (+33)4.11.93.22.02

S.A.S au capital de 3000€
Immatriculée au R.C.S de Montpellier
N° SIRET : 799 621 636 00031
Code APE : 7112B


P Auditori Home contribue au respect de l'environnement. Dans ce cadre, merci de n'imprimer ce mail qu'en cas de nécessité.

6 Auditori Home applique le droit à la déconnexion numérique. Dans ce cadre, les correspondances échangées en dehors des horaires habituels de travail, sauf urgence, n'attendent pas de suite avant le début de la prochaine journée de travail.

--
You received this message because you are subscribed to the Google Groups "pyo-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pyo-discuss...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pyo-discuss/ebd365aa-c108-4587-84bb-e249b02ecd66n%40googlegroups.com.

Tristan SABOURIN

unread,
Aug 16, 2021, 2:26:07 AM8/16/21
to pyo-discuss
Thanks a lot for your answer, it works ! Is there a mean to set the max value of the VuMeter ? Thanks

Olivier Bélanger

unread,
Aug 17, 2021, 9:43:06 PM8/17/21
to pyo-d...@googlegroups.com
Hi,

I don't think so... You hit the red step when you peak at 0 dB.

Olivier


Jonathan Jenkins

unread,
Sep 2, 2021, 10:20:22 AM9/2/21
to pyo-discuss

Hello Olivier,

I'm using the RMS object for a VU meter application as well, but have a strange dilemma. It seems the input audio stream is not necessarily bounded from -1 to 1.

I am using my MacBook Pro's microphone input as the input stream. Normally the range of values provided by .get() is between -1 and 1. However, on peaks, the value can spike as high as 15 or more! This is affecting my db calculation as dBFS should never be above 0 for digital sources.

Any insights would be greatly appreciated! I'm trying to make a very accurate meter and don't simply want to toss out erroneous values when encountered.

Regards,
Jonathan

Olivier Bélanger

unread,
Sep 2, 2021, 8:26:28 PM9/2/21
to pyo-d...@googlegroups.com
Hi,

Pyo's objects (RMS, PeakAmp, Input, ...) don't limit anything. If the signal coming from your mic is very loud, it surely can be higher than 1 within pyo (a linear amplitude of 15 is just about 6 dB over the limit). If you can't be sure of your signal level beforehand, you can either use a Compress object to limit the signal after the Input, or be more radical and put a Clip(your_signal, -1, 1), but be aware that you'll introduce digital distortion in the signal...

Olivier


Jonathan Jenkins

unread,
Sep 2, 2021, 11:46:53 PM9/2/21
to pyo-d...@googlegroups.com
I don’t understand how this is possible in the digital domain. How are the input signals quantized in Pyo? If you have a 16bit audio stream, shouldn’t a sample be represented by a signed 16-bit integer for a total range of 2^16 - 1 values? What are the upper and lower bounds of Input()?

Reply all
Reply to author
Forward
0 new messages