[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

* Jeanette C. <julien@MAIL.UPB.DE> [2022-02-24 12:56]:

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.

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

cheersz, P

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

Hello Peter,
Feb 24 2022, Peter P. has written:
...

By the way, have you seen bird.scm in CLM (Common Lisp Music)?
Scheme, Ruby, and Forth Functions included with Snd
Scheme, Ruby, and Forth Functions included with Snd

...
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. :slight_smile:

Best wishes,

Jeanette

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

Also notable, Øyvind Brandtsegg has some really interesting Csound based feature extraction / analysis techniques in https://github.com/Oeyvind/featexmod/

Hi Richard,
thanks for the links, I am looking through them and I hope that I can make use of those.

Best wishes,

Jeanette

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:
Download: How to install: Cheers, Luís — Luís Antunes Pena Csound mailing list Send bugs reports to Discussions of bugs and features can be posted here

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). :slight_smile: Interesting choice of source material...

Best wishes,

Jeanette

Mar 16 2022, luis antunes pena has written:

That's brilliant, Luís.

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

Csound mailing list Send bugs reports to Discussions of bugs and features can be posted here

It’s really great Luís. Thanks for sharing

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