Velocity Value of a Sound File?
I'm a beginner using MaxMSP, but I know the basics. I'd like to know how to retrieve the velocity value of a soundfile, which sfplay~ and sfinfo~ don't provide. What I mean by the velocity value isn't the constant play volume, but the value continuously changing depending on what the soundfile is actually playing. For example, if the soundfile is playing silence, it would be 0. If it's playing an instrument quietly it would be about 30 or 40, but if it's a full orchestra or a dance music file with heavy bass, it's more likely to be 110 or 120.
I hope it's possible to do this pretty simply and easily, so please help if you know a way to get this value. Thanks.
Search the archive for "envelope following".
Best,
Trond
Chris wrote:
> I'm a beginner using MaxMSP, but I know the basics. I'd like to know how to retrieve the velocity value of a soundfile, which sfplay~ and sfinfo~ don't provide. What I mean by the velocity value isn't the constant play volume, but the value continuously changing depending on what the soundfile is actually playing. For example, if the soundfile is playing silence, it would be 0. If it's playing an instrument quietly it would be about 30 or 40, but if it's a full orchestra or a dance music file with heavy bass, it's more likely to be 110 or 120.
>
> I hope it's possible to do this pretty simply and easily, so please help if you know a way to get this value. Thanks.
check out the [peakamp~] help file
Quote: MegaLamb wrote on Wed, 09 January 2008 17:45
----------------------------------------------------
> I'm a beginner using MaxMSP, but I know the basics. I'd like to know how to retrieve the velocity value of a soundfile, which sfplay~ and sfinfo~ don't provide. What I mean by the velocity value isn't the constant play volume, but the value continuously changing depending on what the soundfile is actually playing. For example, if the soundfile is playing silence, it would be 0. If it's playing an instrument quietly it would be about 30 or 40, but if it's a full orchestra or a dance music file with heavy bass, it's more likely to be 110 or 120.
>
> I hope it's possible to do this pretty simply and easily, so please help if you know a way to get this value. Thanks.
----------------------------------------------------
If you're talking actual audio, then you don't want to look for velocity.
Look at the avg~ object.
It gives you the average amplitude (0. to 1.) between bangs (so put a metro
on it, play with the timing for best results, depends on whether you want
more generalised averages or faster reaction times). So you'll be working in
a range of 0 to 1. You can put the output through a atodb object to get
decibels out, or if you really want you can put it into a scale object with
the parameters "0. 1. 0 128" to scale it to the range of midi velocity.
Hope this helps.
On 09/01/2008, Chris wrote:
>
>
> I'm a beginner using MaxMSP, but I know the basics. I'd like to know how
> to retrieve the velocity value of a soundfile, which sfplay~ and sfinfo~
> don't provide. What I mean by the velocity value isn't the constant play
> volume, but the value continuously changing depending on what the soundfile
> is actually playing. For example, if the soundfile is playing silence, it
> would be 0. If it's playing an instrument quietly it would be about 30 or
> 40, but if it's a full orchestra or a dance music file with heavy bass, it's
> more likely to be 110 or 120.
>
> I hope it's possible to do this pretty simply and easily, so please help
> if you know a way to get this value. Thanks.
>
An 'envelope follower' is what you need, which puts out the average
amplitude of the incoming audio. They are easy to build in MaxMSP,
and there are a few floating around on the forums.
Here's one I built, along with a help/demo patch.
Save as sm.env-follow~.mxb:
----------
Save as sm.env-follow~.help:
----------
On Jan 9, 2008, at 4:45 PM, Chris wrote:
>
> I'm a beginner using MaxMSP, but I know the basics. I'd like to
> know how to retrieve the velocity value of a soundfile, which
> sfplay~ and sfinfo~ don't provide. What I mean by the velocity
> value isn't the constant play volume, but the value continuously
> changing depending on what the soundfile is actually playing. For
> example, if the soundfile is playing silence, it would be 0. If
> it's playing an instrument quietly it would be about 30 or 40, but
> if it's a full orchestra or a dance music file with heavy bass,
> it's more likely to be 110 or 120.
>
> I hope it's possible to do this pretty simply and easily, so please
> help if you know a way to get this value. Thanks.
----
Steven M. Miller
Professor, Contemporary Music Program
College of Santa Fe
Home
SFIFEM
Atrium Sound Space
OVOS
CMP
Thanks very much guys, especially to Steven as that patch does exactly what I need!
Thanks again and see ya later,
Chris
At 4:45 PM +0000 1/9/08, Chris wrote:
>I'm a beginner using MaxMSP, but I know the basics. I'd like to know how to retrieve the velocity value of a soundfile, which sfplay~ and sfinfo~ don't provide.
If you'll allow me to indulge in some pedantic pedagogy for a moment, a sound file isn't going to have a velocity, per se. An amplitude envelope can be derived from a sound file, but velocity is not a useful concept for a sound file. There are many ways to derive an amplitude envelope from a sound. This is usually called "envelope following" or sometimes "envelope extraction".
The quickest and dirtiest may be to use peakamp~ or if you want built-in metering, the output of meter~. You may want to smooth the value coming out of peakamp~ or meter~ though, with something like slide~.
fiddle~, by Miller Puckette, is expensive in terms of cpu because it analyzes pitch, but it also analyzes envelopes really well. You can find fiddle~ on MaxObjects.com.
-C
--
Chris Muir | "There are many futures and only one status quo.
cbm@well.com | This is why conservatives mostly agree,
http://www.xfade.com | and radicals always argue." - Brian Eno
On 9 Jan 2008, at 18:01, Chris Muir wrote:
> If you'll allow me to indulge in some pedantic pedagogy for a
> moment, a sound file isn't going to have a velocity, per se.
Around 770mph, it says here. (Depending on temperature, altitude,
humidity, ...)
-- N.
Nick Rothwell / Cassiel.com Limited
www.cassiel.com
www.myspace.com/cassieldotcom
www.last.fm/music/cassiel
www.reverbnation.com/cassiel
www.linkedin.com/in/cassiel
www.loadbang.net
At 7:03 PM +0000 1/9/08, Nick Rothwell wrote:
>On 9 Jan 2008, at 18:01, Chris Muir wrote:
>
>>If you'll allow me to indulge in some pedantic pedagogy for a moment, a sound file isn't going to have a velocity, per se.
>
>Around 770mph, it says here. (Depending on temperature, altitude, humidity, ...)
Laden or unladen?
-C
--
Chris Muir | "There are many futures and only one status quo.
cbm@well.com | This is why conservatives mostly agree,
http://www.xfade.com | and radicals always argue." - Brian Eno
Wouldn't the velocity of the soundfile be at least somewhat dependent
on the speed with which you throw the host computer out the window?
On Jan 9, 2008, at 12:35 PM, Chris Muir wrote:
> At 7:03 PM +0000 1/9/08, Nick Rothwell wrote:
>> On 9 Jan 2008, at 18:01, Chris Muir wrote:
>>
>>> If you'll allow me to indulge in some pedantic pedagogy for a
>>> moment, a sound file isn't going to have a velocity, per se.
>>
>> Around 770mph, it says here. (Depending on temperature, altitude,
>> humidity, ...)
>
> Laden or unladen?
----
Steven M. Miller
Professor, Contemporary Music Program
College of Santa Fe
Home
SFIFEM
Atrium Sound Space
OVOS
CMP