Csound Csound-dev Csound-tekno Search About

Pitch tracing?

Date1997-04-09 13:03
FromSteven Curtin
SubjectPitch tracing?
I have a general question-

I'd like to take soundfiles or recordings of instruments and use their
articulation microstructure (vibrato, etc) to control Csound instruments.
This involves reading the pitch or fundamental frequency and turning it
into a table or linseg which would then be applied to pitch, amplitude or
whatever.  

What's the most "off the shelf" way to do this in Csound?  Right now I'm
thinking of using Hetro or Pvoc to get the frequencies and find the
lowest/loudest one.  This involves frequency tracking algorithms and such,
which I don't have direct experience with.  Any "prior art" in this area
would be appreciated.

I remember seeing Ben Brunner, an ethnomusicologist at UC-Berkeley who
runs/ran the Gamelan there, using something from MusicKit to trace the
frequencies of Indonesian Rebab and vocalists- this is the sort of thing
I'm thinking of.  

regards,

Steven Curtin

--------------------------------------------------------------
Steven Curtin  
http://www.emf.org/people_curtin.html
Lucent Technologies - Bell Labs Innovations
rm. 3C-208, 200 Laurel Ave S
Middletown, NJ 07748-4801  U S A
ph: (908)957-2996   fax: (908)957-6878
--------------------------------------------------------------



Received: from stork2.maths.bath.ac.uk by omphalos.maths.Bath.AC.UK id aa14922;
          9 Apr 97 15:05 BST
Received: from goggins.bath.ac.uk by stork.maths.Bath.AC.UK id aa01375;
          9 Apr 97 15:04 BST
Received: from hermes.ex.ac.uk by goggins.bath.ac.uk with SMTP (PP);
          Wed, 9 Apr 1997 15:04:30 +0100
Received: from noether [144.173.8.10] by hermes via SMTP (OAA04109);
          Wed, 9 Apr 1997 14:50:40 +0100
Received: from hermes.ex.ac.uk by maths.exeter.ac.uk;
          Wed, 9 Apr 97 14:50:27 +0100
Received: from root@big.fishnet.net [205.216.133.3] by hermes 
          via ESMTP (OAA04057); Wed, 9 Apr 1997 14:50:13 +0100
Received: from sinewave (port001.vta.fishnet.net [205.216.133.150]) 
          by big.fishnet.net (8.7.5/8.6.9) with SMTP id FAA29522;
          Wed, 9 Apr 1997 05:53:28 -0700
Message-Id: <334B90D5.166EED6B@rcsreg.com>
Date: Wed, 09 Apr 1997 05:51:33 -0700
From: Toby 
X-Mailer: Mozilla 3.01Gold (X11; I; Linux 2.0.27 i486)
Mime-Version: 1.0
To: Pablo Silva 
Cc: Csound Mailing List 
Subject: Re: Eliminating Noise
References: 
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Sender: owner-csound-outgoing@maths.ex.ac.uk
Precedence: bulk

> Does this mean we would need to have a kr of the
> same value as the sr to get truly clean results? This, it seems to me,
> would make the difference between control signals and audio signals moot,
> and of course would dramatically increment computation time.

Well sure, there will never be a setting as perfect as ksmps=1.
I wouldn't want my final product to be rendered any other way.
At the same time, it is very useful to have the ability of
using other ratios.  Many times it is the only way to achieve
the level of real-time performance needed on a particular machine.

I will often use 20000,200,100 during the development of a
piece fragment when repetitive computations of a sco/orc 
would otherwise consume to much time.  Then, as the material
begins to solidify into something close to the final product,
I will begin to approach 44100,1,1 for the final computations.

Toby

	-There otta be a law-



Received: from stork2.maths.bath.ac.uk by omphalos.maths.Bath.AC.UK id aa14957;
          9 Apr 97 15:18 BST
Received: from goggins.bath.ac.uk by stork.maths.Bath.AC.UK id aa01442;
          9 Apr 97 15:18 BST
Received: from hermes.ex.ac.uk by goggins.bath.ac.uk with SMTP (PP);
          Wed, 9 Apr 1997 15:16:51 +0100
Received: from noether [144.173.8.10] by hermes via SMTP (OAA04523);
          Wed, 9 Apr 1997 14:56:38 +0100
Received: from hermes.ex.ac.uk by maths.exeter.ac.uk;
          Wed, 9 Apr 97 14:56:28 +0100
Received: from root@tamata.NAUTA.IT [194.21.179.2] by hermes 
          via ESMTP (OAA04138); Wed, 9 Apr 1997 14:50:55 +0100
Received: from [194.21.179.36] (serial5.nauta.it [194.21.179.36]) 
          by mail.nauta.it (8.6.12/8.6.9) with SMTP id PAA15343;
          Wed, 9 Apr 1997 15:49:42 +0200
Message-Id: 
Mime-Version: 1.0
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Date: Wed, 9 Apr 1997 15:53:29 +0400
To: csound@maths.ex.ac.uk, tre@shoko.calarts.edu, icma@umich.edu, 
    max <@cunyvm.cuny.edu:max@mcgill.bitnet>, music-research@comlab.ox.ac.uk, 
    notmus-l@ubvm.cc.buffalo.edu, musgg@luxor.latrobe.edu.au, 
    mooreaj@sun1.bham.ac.uk, mto-editor@boethius.music.ucsb.edu, 
    amr@farben.latrobe.edu.au, cecdiscuss@clyde.concordia.ca, Emfnet@aol.com, 
    eilara@spinoza.tav.ac.il.music.mcgill.ca, eirikli@notam.uio.no, 
    ejl@netcom.com, ejrnl@uacsc2.albany.edu, ejurschi@sos.mhs.compuserve.com
From: Vittorio Vella 
Subject: TauKay Edizioni Musicali
Sender: owner-csound-outgoing@maths.ex.ac.uk
Precedence: bulk

Dear driend,
        it's over a year since we created our site on internet and since
then many things have happened.
        More and more people have joined this great system of communication
which eliminates distances and riduces publishing times.
        Thanks to internet it is possible to contact and inform composers
from all over the world to carry out new initiatives.
        Last year we were able to carry out our ambitious plan of the First
National Contemporary Music competition "Citt=E0 di Udine".
        In the Jury there were expert journalist and Composers who chose
seven pieces among the over a hundred that were submitted.
        The National Preview of the selected pieces was held during the
Review "Contemporanea 96", organized together with the "Assessorato alla
Cultura" of Udine.
        The music recorded during those evenings was then produced on CD
(TauKay 103 - TauKay 104)
        We're going to carry out the second edition of the competition end
to enlarge the catalogue including young Composers' new proposals, as well
as a new field regarding theatrical initiatives and their links with Music,
and also the study on new topics with the help of a selected essays.
        Our web site is where creative energies can meet and where we can
know each other.
        We look forward to nearing your ideas to continue together.

The Editor:   Vittorio Vella
email:           taikay@mailbox.nauta.it
Web site:      http://www.nauta.it/taukay/

Gentile amico,
        =E8 passato pi=F9 di un anno da quando =E8 stato aperto il nostro=
 sito su
internet e da allora molte cose sono cambiate.
        Una quantit=E0 sempre maggiore di persone si =E8 avvicinata a questo
formidabile mezzo di comunicazione che permette di azzerare le distanze e
ridurre i tempi editoriali.
        Grazie a Internet =E8 possibile contattare e informare Compositori d=
i
tutto il mondo per sviluppare nuove iniziative.
        Durante l'anno passato si =E8 concretizzato il nostro ambizioso
progetto legato al Primo Concorso Nazionale di Musica Contemporanea "Citt=E0
di Udine".
        LA Giuria, composta da giornalisti del settore  e Compositori, ha
scelto sette Opere tra le oltre cento pervenute.
        L'esecuzione in Prima Nazionale dei lavori selezionati si =E8 tenuta
in occasione della Rassegna "Contemporanea '96", organizzata in
collaborazione con l'Assessorato alla Cultura del Comune di Udine .
        Il materiale registrato durante le serate =E8 stato inciso su compac=
t
disc. (TauKay 103 - TauKay 104)
        Nei progetti futuri c'=E8 la seconda edizione del Concorso,
l'ampliamento del catalogo con proposte di giovani compositori, un nuovo
settore relativo al teatro e ai suoi rapporti con la Musica e
l'approfondimento di nuovi temi attraverso saggistica specializzata.
        Il nostro sito web rappresenta uno spazio in cui convogliare
energie creative, un luogo dove apparire per farsi conoscere.
        Aspettiamo le tue idee per proseguire insieme la strada iniziata.

Il responsabile editoriale:Vittorio Vella
Posta elettronica:             taukay@mailbox.nauta.it
sito web:                          http://www.nauta.it/taukay/




*****************************************************
Edizioni Musicali TauKay
TauKay Music Publishing House
via Fiume 13 - 33100 Udine - Italy
tel.   +39-432-506677
fax   +39-432-25021
taukay@mailbox.nauta.it
WEB site   http://www.nauta.it/taukay/indice.htm
Responsabile editoriale/Editor: Vittorio Vella
*****************************************************





Received: from stork2.maths.bath.ac.uk by omphalos.maths.Bath.AC.UK id aa14963;
          9 Apr 97 15:19 BST
Received: from goggins.bath.ac.uk by stork.maths.Bath.AC.UK id aa01447;
          9 Apr 97 15:18 BST
Received: from hermes.ex.ac.uk by goggins.bath.ac.uk with SMTP (PP);
          Wed, 9 Apr 1997 15:18:23 +0100
Received: from noether [144.173.8.10] by hermes via SMTP (OAA04701);
          Wed, 9 Apr 1997 14:58:35 +0100
Received: from hermes.ex.ac.uk by maths.exeter.ac.uk;
          Wed, 9 Apr 97 14:58:21 +0100
Received: from condor.CC.UMontreal.CA [132.204.2.103] by hermes 
          via ESMTP (OAA04684); Wed, 9 Apr 1997 14:58:12 +0100
Received: from eole.ERE.UMontreal.CA (eole.ERE.UMontreal.CA [132.204.2.70]) 
          by condor.CC.UMontreal.CA with ESMTP id JAA13221  (8.6.11/IDA-1.6 
          for ); Wed, 9 Apr 1997 09:51:45 -0400
Received: from mistral.ERE.UMontreal.CA 
          by eole.ERE.UMontreal.CA (951211.SGI.8.6.12.PATCH1042/5.17)	id JAA27242;
          Wed, 9 Apr 1997 09:56:13 -0400
Received: from GAP 
          by mistral.ERE.UMontreal.CA (951211.SGI.8.6.12.PATCH1042/5.17)	id JAA15817;
          Wed, 9 Apr 1997 09:56:10 -0400
Message-Id: <334B9CDA.1CFB@ere.umontreal.ca>
Date: Wed, 09 Apr 1997 09:42:50 -0400
From: Jean Piche 
X-Mailer: Mozilla 3.01SGoldC-SGI (X11; I; IRIX 6.3 IP32)
Mime-Version: 1.0
To: csound 
Subject: Re: Pitch tracing?
References: <3.0.32.19970409080328.0069cff8@mtm3.mt.lucent.com>
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Sender: owner-csound-outgoing@maths.ex.ac.uk
Precedence: bulk

Steven Curtin wrote:
> 
> I have a general question-
> 
> I'd like to take soundfiles or recordings of instruments and use their
> articulation microstructure (vibrato, etc) to control Csound instruments.
> This involves reading the pitch or fundamental frequency and turning it
> into a table or linseg which would then be applied to pitch, amplitude or
> whatever.
> 
> What's the most "off the shelf" way to do this in Csound?  Right now I'm
> thinking of using Hetro or Pvoc to get the frequencies and find the


lpread will give you pitch, amp and a "spectral index" consisting of
series of multipole filter coefficients frames that are passed on
internally to an lpreson ugen. You must of course analyse the soundfile
with lpanal. You can stash these functions (except the filters of
course) into a function table by first wrtting them out to a file via
the kdump ugen. You then reopen into a table with a gen01.


-- 
________________________________________________________
Jean Piche
Universite de Montreal
http://mistral.ere.umontreal.ca/~pichej
http://www.musique.umontreal.ca/Org/CompoElectro/CEC/



Received: from stork2.maths.bath.ac.uk by omphalos.maths.Bath.AC.UK id aa15079;
          9 Apr 97 16:30 BST
Received: from goggins.bath.ac.uk by stork.maths.Bath.AC.UK id aa02309;
          9 Apr 97 16:30 BST
Received: from hermes.ex.ac.uk by goggins.bath.ac.uk with SMTP (PP);
          Wed, 9 Apr 1997 16:30:23 +0100
Received: from noether [144.173.8.10] by hermes via SMTP (PAA07863);
          Wed, 9 Apr 1997 15:50:38 +0100
Received: from hermes.ex.ac.uk by maths.exeter.ac.uk;
          Wed, 9 Apr 97 15:50:28 +0100
Received: from Thuban.AC.HMC.Edu [134.173.53.8] by hermes via ESMTP (PAA07823);
          Wed, 9 Apr 1997 15:50:08 +0100
Received: from [134.173.38.61] (Spjut.Eng.HMC.Edu) 
          by THUBAN.AC.HMC.EDU (PMDF V5.1-5 #18017) with ESMTP 
          id <01IHHSR1936A8WYD6Y@THUBAN.AC.HMC.EDU> 
          for csound@noether.ex.ac.uk; Wed, 9 Apr 1997 07:49:42 PDT
Date: Wed, 09 Apr 1997 07:52:15 -0700
From: Erik Spjut 
Subject: Re: Eliminating Noise
In-Reply-To: 
X-Sender: spjut@thuban.ac.hmc.edu
To: Pablo Silva , csound@maths.ex.ac.uk
Message-Id: 
Mime-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Sender: owner-csound-outgoing@maths.ex.ac.uk
Precedence: bulk

At 12:47 AM -0600 4/9/97, Pablo Silva wrote:
>Hello, CSounders:
>
>On April 8, 1997 Tobias Kunze wrote:
>
>>The
>>signal is clean at kr = sr only.  I get ~20dB sidelobes at
>>ksmps = 100.
>
>Does this mean we would need to have a kr of the
>same value as the sr to get truly clean results?

The issue is very much dependent on instrument specifics. If you
are just running a-rate oscil's with a-rate envelopes, ksmps doesn't
have an influence on noise. If you use k-rate envelopes, you'll get
noise except at ksmps=1. If you run a ugen like foscil where k-rate
parameters directly affect the signal and you vary the parameters during
a note, you'll get noise except at ksmps=1. A k-rate signal used to vary
a low-frequency signal (e.g., a randomizer on a vibrato) is usually OK.
Some ugen's like gain or balance multiply everything by a constant
which is fixed during a k-frame but changes from frame to frame. They
only work properly at ksmps=1. Some other things such as home-grown
recursive (IIR) filters or pulse-width modulation only work at ksmps=1.

Everything tends to work better but more slowly at ksmps=1, but it is
not always necessary for noise reduction. I hope that clarifies things.

-----------------------------------------------------------------------------
Erik Spjut (rhymes with cute) - Associate Professor of Engineering   and/or
Associate Director for Engineering Computing in the Engineering Design Center
Harvey Mudd College, Claremont, CA 91711  USA
Erik_Spjut@hmc.edu     Ph & Voice mail (909) 607-3890     Fax (909) 621-8967





Received: from stork2.maths.bath.ac.uk by omphalos.maths.Bath.AC.UK id aa15325;
          9 Apr 97 18:29 BST
Received: from goggins.bath.ac.uk by stork.maths.Bath.AC.UK id aa05301;
          9 Apr 97 18:28 BST
Received: from hermes.ex.ac.uk by goggins.bath.ac.uk with SMTP (PP);
          Wed, 9 Apr 1997 18:28:42 +0100
Received: from noether [144.173.8.10] by hermes via SMTP (SAA15596);
          Wed, 9 Apr 1997 18:13:00 +0100
Received: from hermes.ex.ac.uk by maths.exeter.ac.uk;
          Wed, 9 Apr 97 18:12:50 +0100
Received: from mail.u-net.net [194.119.128.80] by hermes via ESMTP (SAA15585);
          Wed, 9 Apr 1997 18:12:50 +0100
Received: from bud.u-net.com ([194.119.169.233]) by mail.u-net.net with SMTP 
          id <1312411-1000>; Wed, 9 Apr 1997 18:04:34 +0100
X-Sender: mike-bud@mail.u-net.com
X-Mailer: Windows Eudora Version 1.4.4
Mime-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
To: csound@maths.ex.ac.uk
From: Mike Chapman 
Subject: Re: In or out of opcodes?
Message-Id: <97Apr9.180434+0100_bst.1312411-1000+54@mail.u-net.net>
Date: 	Wed, 9 Apr 1997 18:04:33 +0100
Sender: owner-csound-outgoing@maths.ex.ac.uk
Precedence: bulk

Wow,

> I'm afraid I have to agree with the other opinions - MIDI out on 
> csound doesn't make sense! 

I never thought i would here people ask someone not to include an opcode. 
I think the MIDI-out opcodes sound like a good idea (if i could only get the 
realtime output working !). Surely more ugens and more connections to the 
outside world has to be good news for users? I think there has been  
a great tendency not to include features for this reason or that.
This just seems silly - for the extra few KB of executable space
thro 'em in and bump up Hard Disk sales. Go on be devils... Let the 
imagination go wild. How about audio compression/decompression ugens. 
How about picture import/process/export ugens. These could be superb
for animation / compositing / video mixing with all the control 
possibilities of an orc / sco combination. Michael Gogins has done the
dynamic link of opcodes so we can deliver groups of opcodes as dlls or
shared unix libraries etc. This has to be worth incorporation to the 
core?

>I will implement it anyway in next version. New UGs will not compromise
>normal behaviour of realtime Csound, so, if you aren't interested in
>MIDI OUT UGs simply ignore them.

Yep....

I think perhaps another more fruitful approach may be 
a 'data streamer' for want of a better name.  A program  
that can schedule the routing of signals between devices
based on an event list. 

Wish list as follows:-

 Simple event syntax (based on csound note format) to control
 playback of files. 

 Route data to/from 'devices' in time to an underlying clock.
 SMPTE or Midi clock. 

 In this context i would describe valid links as RAM, DISK, NETWORK,
 AUDIO IO, DIGITAL IO.  

 Implement a shared library for time based signal and event routing.
 

It is the connection of various time-based drivers that is the problem.
Bus bandwidth, DMA channel and interrupt shortages conspire to
keep 32 track hard disk recording a way out of reach on my PC. 

Large improvements in the interactivity of musical processes (which i 
feel we all want) will have to use multiple processors/devices. A 
time based routing/sequencing program will be essential.
 
The technologies we need are well established it is just assembling
the right mix. Csound in my eyes is just one implementation model of 
sound synthesis. Superb experimental instrument design. Ambient 
'head' processing effects with weird gates / filters and delays all
modulating away. Just superb but interaction factor 0. Smile factor 5.
Make it realtime smile factor goes to 11. And by real time - i suppose
we have to be realistic. The fastest computer in the world, a Cray 
Sm-Blib-Blob would only do so much real time modulation and 
interface design would still be important. 

PS. Any criticisms of any current stuff is solely to point out what
it could (hopefuly will) be like. I am immensely grateful for all the
EXCELLENT work that i use especially csound. I hope to contribute some
myself soon. 

Thanks for listening.

Bye,


Mike