Csound Csound-dev Csound-tekno Search About

[Csnd] Sound analysis without graphical feedback

Date2022-02-24 11:56
From"Jeanette C."
Subject[Csnd] Sound analysis without graphical feedback
Hey hey,
I am trying to analyse bird song, the recordings will naturally have some 
background noise, though most of it can be cleaned up. The final goal is to 
synthesize bird calls, after other, earlier attempts failed.

There are good ways to represent such monophinic signals graphically to get a 
good idea of pitch and volume change. Since graphical representations are 
inaccessible to me, I am looking for a more systematic textual representation. 
Are there ways to perform this taks with Csound alone or are there tools or 
extensions for big math applications such as octave, R or maxima to determine 
peaks of frequencies and amplitudes and perhaps even curve approximations 
describing the changes between such peaks?

Has anyone here undertaken a similar analysis supported by Csound?

Best wishes and thanks for any hints,

Jeanette

-- 
  * Website: http://juliencoder.de - for summer is a state of sound
  * Youtube: https://www.youtube.com/channel/UCMS4rfGrTwz8W7jhC1Jnv7g
  * Audiobombs: https://www.audiobombs.com/users/jeanette_c
  * GitHub: https://github.com/jeanette-c

Don't care about money
It doesn't give me half the thrill <3
(Britney Spears)

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Date2022-02-24 12:11
From"Peter P."
SubjectRe: [Csnd] Sound analysis without graphical feedback
AttachmentsNone  

Date2022-02-27 00:01
From"Jeanette C."
SubjectRe: [Csnd] Sound analysis without graphical feedback
Hello Peter,
Feb 24 2022, Peter P. has written:
...
> By the way, have you seen bird.scm in CLM (Common Lisp Music)?
> https://ccrma.stanford.edu/software/snd/snd/sndscm.html#bird
> https://ccrma.stanford.edu/software/snd/snd/sndscm.html#animalsdoc
...
Thanks for those links. I have looked at them. I can't decipher them,
but I am working on that. I suppose there might be some help in those
bird calls. The envelope shapes might be a good step forward.

It would still be good to have a tool for further analysis of audio
recordings. So if anyone has a suggestion, I am still looking. Such
helpers for analysis are sometimes useful, not only for synthesizing
bird song. :)

Best wishes,

Jeanette

-- 
  * Website: http://juliencoder.de - for summer is a state of sound
  * Youtube: https://www.youtube.com/channel/UCMS4rfGrTwz8W7jhC1Jnv7g
  * Audiobombs: https://www.audiobombs.com/users/jeanette_c
  * GitHub: https://github.com/jeanette-c

There's a girl in the mirror
I wonder who she is
Sometimes I think I know her
Sometimes I really wish I did <3
(Britney Spears)

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Date2022-03-01 00:53
FromRichard Knight
SubjectRe: [Csnd] Sound analysis without graphical feedback
Hi

I sometimes use Csound for some basic analysis and think there is quite 
a bit of scope for developing in-depth approaches. Here is a fairly 
basic example of the sort of thing I do:
     http://userfiles.1bpm.net/cs_example/analysis/analysis_example.html
     (and the raw CSD - 
http://userfiles.1bpm.net/cs_example/analysis/analysis_example.csd )
     this example uses 
http://userfiles.1bpm.net/cs_example/analysis/test.wav

The output from the example CSD gives the text:

Start: 0.124000 ; End: 4.124000 ; Pitch min: 188.235294, max: 
657.534247, avg: 623.896755 ; Centroid min: 2492.601178, max: 
5333.084601, avg: 3276.696148
Start: 5.857333 ; End: 9.074667 ; Pitch min: 436.363636, max: 
5333.333333, avg: 937.918167 ; Centroid min: 2173.124842, max: 
11985.012861, avg: 2550.169149
Start: 9.076000 ; End: 13.569333 ; Pitch min: 436.363636, max: 
2181.818182, avg: 2133.588831 ; Centroid min: 3206.290090, max: 
6883.542139, avg: 5076.361830
Start: 13.570667 ; End: 18.561333 ; Pitch min: 2181.818182, max: 
8000.000000, avg: 2885.677004 ; Centroid min: 3214.463470, max: 
6472.805549, avg: 3679.556923


Basically it borrows from the pvsbufread manual page example to perform 
some analysis operations in a single k-cycle. The min/max/mean RMS of 
the input file are first determined so that then a ratio can be used to 
segment into parts. Then on each part the min/max/mean pitches and 
centroids are extracted along with start/end times.
I think it would be possible to extend this idea to incorporate things 
like analysis of changes between identified segments (eg if the pitch 
differs by a certain threshold etc), peaks/etc, perhaps with transient 
detection, and then that be used to get more of the detailed sort of 
thing you are looking for. There are a lot of 
possibilities/parameters/things to try but hopefully this may help in 
some way.




All the best
Richard


On 2022-02-27 00:01, Jeanette C. wrote:
> Hello Peter,
> Feb 24 2022, Peter P. has written:
> ...
>> By the way, have you seen bird.scm in CLM (Common Lisp Music)?
>> https://ccrma.stanford.edu/software/snd/snd/sndscm.html#bird
>> https://ccrma.stanford.edu/software/snd/snd/sndscm.html#animalsdoc
> ...
> Thanks for those links. I have looked at them. I can't decipher them,
> but I am working on that. I suppose there might be some help in those
> bird calls. The envelope shapes might be a good step forward.
> 
> It would still be good to have a tool for further analysis of audio
> recordings. So if anyone has a suggestion, I am still looking. Such
> helpers for analysis are sometimes useful, not only for synthesizing
> bird song. :)
> 
> Best wishes,
> 
> Jeanette
> 
> --
>  * Website: http://juliencoder.de - for summer is a state of sound
>  * Youtube: https://www.youtube.com/channel/UCMS4rfGrTwz8W7jhC1Jnv7g
>  * Audiobombs: https://www.audiobombs.com/users/jeanette_c
>  * GitHub: https://github.com/jeanette-c
> 
> There's a girl in the mirror
> I wonder who she is
> Sometimes I think I know her
> Sometimes I really wish I did <3
> (Britney Spears)
> 
> Csound mailing list
> Csound@listserv.heanet.ie
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> Send bugs reports to
>        https://github.com/csound/csound/issues
> Discussions of bugs and features can be posted here

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Date2022-03-01 00:58
FromRichard Knight
SubjectRe: [Csnd] Sound analysis without graphical feedback
Also notable, Øyvind Brandtsegg has some really interesting Csound based 
feature extraction / analysis techniques in 
https://github.com/Oeyvind/featexmod/

https://github.com/Oeyvind/featexmod

On 2022-03-01 00:53, Richard Knight wrote:
> Hi
> 
> I sometimes use Csound for some basic analysis and think there is
> quite a bit of scope for developing in-depth approaches. Here is a
> fairly basic example of the sort of thing I do:
>     http://userfiles.1bpm.net/cs_example/analysis/analysis_example.html
>     (and the raw CSD -
> http://userfiles.1bpm.net/cs_example/analysis/analysis_example.csd )
>     this example uses 
> http://userfiles.1bpm.net/cs_example/analysis/test.wav
> 
> The output from the example CSD gives the text:
> 
> Start: 0.124000 ; End: 4.124000 ; Pitch min: 188.235294, max:
> 657.534247, avg: 623.896755 ; Centroid min: 2492.601178, max:
> 5333.084601, avg: 3276.696148
> Start: 5.857333 ; End: 9.074667 ; Pitch min: 436.363636, max:
> 5333.333333, avg: 937.918167 ; Centroid min: 2173.124842, max:
> 11985.012861, avg: 2550.169149
> Start: 9.076000 ; End: 13.569333 ; Pitch min: 436.363636, max:
> 2181.818182, avg: 2133.588831 ; Centroid min: 3206.290090, max:
> 6883.542139, avg: 5076.361830
> Start: 13.570667 ; End: 18.561333 ; Pitch min: 2181.818182, max:
> 8000.000000, avg: 2885.677004 ; Centroid min: 3214.463470, max:
> 6472.805549, avg: 3679.556923
> 
> 
> Basically it borrows from the pvsbufread manual page example to
> perform some analysis operations in a single k-cycle. The min/max/mean
> RMS of the input file are first determined so that then a ratio can be
> used to segment into parts. Then on each part the min/max/mean pitches
> and centroids are extracted along with start/end times.
> I think it would be possible to extend this idea to incorporate things
> like analysis of changes between identified segments (eg if the pitch
> differs by a certain threshold etc), peaks/etc, perhaps with transient
> detection, and then that be used to get more of the detailed sort of
> thing you are looking for. There are a lot of
> possibilities/parameters/things to try but hopefully this may help in
> some way.
> 
> 
> 
> 
> All the best
> Richard
> 

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Date2022-03-01 09:42
From"Jeanette C."
SubjectRe: [Csnd] Sound analysis without graphical feedback
Hi Richard,
thanks for the links, I am looking through them and I hope that I can make use 
of those.

Best wishes,

Jeanette

-- 
  * Website: http://juliencoder.de - for summer is a state of sound
  * Youtube: https://www.youtube.com/channel/UCMS4rfGrTwz8W7jhC1Jnv7g
  * Audiobombs: https://www.audiobombs.com/users/jeanette_c
  * GitHub: https://github.com/jeanette-c

Ain't no way I'll be lonely <3
(Britney Spears)

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Date2022-03-16 16:11
Fromluis antunes pena
SubjectRe: [Csnd] Sound analysis without graphical feedback
Hi Jeanette,

I have made some years ago a tool for analysis that I'm using for some compositions. It is a unix script that calls csound to analyse a sound and returns a text file with time/freq/amp information. I currently use this text in Lisp/OpenMusic but you could easilly change the format to a coll object in Max/MSP, for example - or use it in csound for sound synthesis. You can take a look at it here:

Demo:
https://vimeo.com/261474695

Download:
http://icem.folkwang-uni.de/~pena/samp2fft.zip

How to install:
http://luisantunespena.eu/downloads.html

Cheers,

Luís

---

Luís Antunes Pena
http://luisantunespena.eu

On 24.02.22 12:56, Jeanette C. wrote:
Hey hey,
I am trying to analyse bird song, the recordings will naturally have some background noise, though most of it can be cleaned up. The final goal is to synthesize bird calls, after other, earlier attempts failed.

There are good ways to represent such monophinic signals graphically to get a good idea of pitch and volume change. Since graphical representations are inaccessible to me, I am looking for a more systematic textual representation. Are there ways to perform this taks with Csound alone or are there tools or extensions for big math applications such as octave, R or maxima to determine peaks of frequencies and amplitudes and perhaps even curve approximations describing the changes between such peaks?

Has anyone here undertaken a similar analysis supported by Csound?

Best wishes and thanks for any hints,

Jeanette




Date2022-03-16 16:22
From"Jeanette C."
SubjectRe: [Csnd] Sound analysis without graphical feedback
Many thanks Luis! The demo sounds interesting. Even if it won't be part of the 
birds project, it sounds like being part of some project(s). :) Interesting 
choice of source material...

Best wishes,

Jeanette

Mar 16 2022, luis antunes pena has written:

> Hi Jeanette,
>
> I have made some years ago a tool for analysis
> that I'm using for some compositions. It is a unix
> script that calls csound to analyse a sound and
> returns a text file with time/freq/amp
> information. I currently use this text in
> Lisp/OpenMusic but you could easilly change the
> format to a coll object in Max/MSP, for example -
> or use it in csound for sound synthesis. You can
> take a look at it here:
>
> Demo:
> https://vimeo.com/261474695
>
> Download:
> http://icem.folkwang-uni.de/~pena/samp2fft.zip
>
> How to install:
> http://luisantunespena.eu/downloads.html
>
> Cheers,
>
> Luís
>
> ---
>
> Luís Antunes Pena
> http://luisantunespena.eu
>
> On 24.02.22 12:56, Jeanette C. wrote:
>>  Hey hey,
>>  I am trying to analyse bird song, the recordings
>>  will naturally have some background noise,
>>  though most of it can be cleaned up. The final
>>  goal is to synthesize bird calls, after other,
>>  earlier attempts failed.
>>
>>  There are good ways to represent such monophinic
>>  signals graphically to get a good idea of pitch
>>  and volume change. Since graphical
>>  representations are inaccessible to me, I am
>>  looking for a more systematic textual
>>  representation. Are there ways to perform this
>>  taks with Csound alone or are there tools or
>>  extensions for big math applications such as
>>  octave, R or maxima to determine peaks of
>>  frequencies and amplitudes and perhaps even
>>  curve approximations describing the changes
>>  between such peaks?
>>
>>  Has anyone here undertaken a similar analysis
>>  supported by Csound?
>>
>>  Best wishes and thanks for any hints,
>>
>>  Jeanette
>> 
>
> --------------------------------------------------
>
> Csound mailing list
> Csound@listserv.heanet.ie
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> Send bugs reports to
>       https://github.com/csound/csound/issues
> Discussions of bugs and features can be posted here
>

-- 
  * Website: http://juliencoder.de - for summer is a state of sound
  * Youtube: https://www.youtube.com/channel/UCMS4rfGrTwz8W7jhC1Jnv7g
  * Audiobombs: https://www.audiobombs.com/users/jeanette_c
  * GitHub: https://github.com/jeanette-c

If there's nothing missing in my life
Then why do these tears come at night <3
(Britney Spears)

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Date2022-03-16 20:56
Fromluis jure
SubjectRe: [Csnd] ***SPAM*** Re: [Csnd] Sound analysis without graphical feedback
el Wed, 16 Mar 2022 17:11:17 +0100
luis antunes pena  escribió:

> You can take a look at it here:
> 
> Demo:
> https://vimeo.com/261474695

 
That's brilliant, Luís.


-- 

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Date2022-03-17 12:45
Fromluis antunes pena
SubjectRe: [Csnd] Re: [Csnd] Sound analysis without graphical feedback
Thanks, Luis and Jeanette. The code was used in an orchestra + electronics piece called "Off Balance" with a strong political message. 
I'm not sure the code is still working properly, but I can check it later if you're interested in using it.

Cheers,
Luís


On 16.03.22 21:56, luis jure wrote:
el Wed, 16 Mar 2022 17:11:17 +0100
luis antunes pena <antunespena@WEB.DE> escribió:

You can take a look at it here:

Demo:
https://vimeo.com/261474695

That's brilliant, Luís.




Luís Antunes Pena
http://luisantunespena.eu


Date2022-03-17 15:26
From"Dr. Richard Boulanger"
SubjectRe: [Csnd] Re: [Csnd] Sound analysis without graphical feedback
It's really great Luís.  Thanks for sharing 

Dr. Richard Boulanger
Professor
Electronic Production and Design
Berklee College of Music

On Mar 17, 2022, at 8:46 AM, luis antunes pena <antunespena@web.de> wrote:

 Thanks, Luis and Jeanette. The code was used in an orchestra + electronics piece called "Off Balance" with a strong political message. 
I'm not sure the code is still working properly, but I can check it later if you're interested in using it.

Cheers,
Luís


On 16.03.22 21:56, luis jure wrote:
el Wed, 16 Mar 2022 17:11:17 +0100
luis antunes pena <antunespena@WEB.DE> escribió:

You can take a look at it here:

Demo:
https://vimeo.com/261474695
That's brilliant, Luís.




Luís Antunes Pena
http://luisantunespena.eu


Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here