| I have it in mind to write a utility with which one can modify the
base frequency of an AIFF file. With this capability, it will be
an easier task to make banks of samples for loscil to read.
Firstly, does anybody know of such a utility or application? I am
looking forward to writing the program, but would rather use an
existing one. By the way, there is an excellent sound editor for
UNIX called 'DAP' which has a really nice interface for auditioning
and setting the loop points in an AIFF file. See Dave Phillips' page.
Second, there is a bit of code in 'aiff.c' that calculates the raw
Hz value of an AIFF sample from the 'baseNote' and 'detune' values
in its InstrumentChunk. This is used by sndinfo to report the raw
frequency, which is not otherwise stored in the AIFF file. Here is
the code:
double onept = 1.021975; /* A440 tuning factor */
oct = (instr.baseNote + instr.detune/100.) / 12. + 3.;
adp->natcps = (float)(pow((double)2.0, oct) * onept);
I understand this code, but why is 'onept' necessary? Isn't MIDI
based on A->440? Anyway, my real question is one of mathematics.
I would like to have the ability in my prospective utility to translate
the natural frequency in the other direction; that is, to convert
a Hertz value to (basenote, detune). The thing that is tough for me
is reverse engineering the call to pow(). natcps = 2^oct, but then
how does one solve for oct? The word logarithm is seeping in from
high school memories, but they are to vague to be of any help to me.
Thanks,
Toby
-There otta be a law-
~
~
~
~
~
Received: from stork.maths.bath.ac.uk by omphalos.maths.Bath.AC.UK id aa05875;
13 Aug 98 14:24 BST
Received: from pat.bath.ac.uk by stork.maths.Bath.AC.UK id aa29417;
13 Aug 98 14:24 BST
Received: (qmail 19859 invoked from network); 13 Aug 1998 13:24:26 -0000
Received: from hermes.ex.ac.uk (HELO exeter.ac.uk) (144.173.6.14)
by pat.bath.ac.uk with SMTP; 13 Aug 1998 13:24:26 -0000
Received: from noether [144.173.8.10] by hermes via SMTP (OAA01092); Thu, 13 Aug 1998 14:18:31 +0100 (BST)
Received: from exeter.ac.uk by maths.ex.ac.uk; Thu, 13 Aug 1998 14:18:20 +0100
Received: from [199.85.19.2] by hermes via ESMTP (OAA27194); Thu, 13 Aug 1998 14:18:18 +0100 (BST)
Received: by fw.osler.com id <20624>; Thu, 13 Aug 1998 09:19:31 -0400
Message-Id: <98Aug13.091931edt.20624@fw.osler.com>
From: "Ruston, Paul"
To: 'Tobiah'
Cc: 'Csound group'
Subject: RE: Modifying AIFF soundfile information...
Date: Thu, 13 Aug 1998 09:17:00 -0400
X-Mailer: Microsoft Exchange Server Internet Mail Connector Version 4.0.995.52
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: owner-csound-outgoing@maths.ex.ac.uk
Precedence: bulk
I doubt if this is what you need exactly but if your math skills are any
better than mine, you may be able to adapt it to your purposes.
To calculate the size of a ratio (interval) in cents:
1200 x log2 (f 1 / f 2) = size in cents (where f 1 represents the
largest component of the ratio). "f" could also be expressed as two
actual "f"requencies.
e.g. 1200 x log2 ( 5 / 4 ) = 386 cents
or
1200 x log2 (550 Hz / 440 Hz) = 386 cents (A to C expressed as a pure
major 3rd)
I think you would then need to have something that converts cents to
'oct', which shouldn't be too hard. However, I never use 'oct' so I
have no further suggestions. (Is this what you're looking for at
all???)
Paul Ruston
>-----Original Message-----
>From: Tobiah [SMTP:toby@rcsreg.com]
>Sent: August 13, 1998 1:12 AM
>To: Csound Mailing List; toby@rcsreg.com
>Subject: Modifying AIFF soundfile information...
>
>I have it in mind to write a utility with which one can modify the
>base frequency of an AIFF file. With this capability, it will be
>an easier task to make banks of samples for loscil to read.
>
>Firstly, does anybody know of such a utility or application? I am
>looking forward to writing the program, but would rather use an
>existing one. By the way, there is an excellent sound editor for
>UNIX called 'DAP' which has a really nice interface for auditioning
>and setting the loop points in an AIFF file. See Dave Phillips' page.
>
>Second, there is a bit of code in 'aiff.c' that calculates the raw
>Hz value of an AIFF sample from the 'baseNote' and 'detune' values
>in its InstrumentChunk. This is used by sndinfo to report the raw
>frequency, which is not otherwise stored in the AIFF file. Here is
>the code:
>
>
>double onept = 1.021975; /* A440 tuning factor */
>
> oct = (instr.baseNote + instr.detune/100.) / 12. + 3.;
> adp->natcps = (float)(pow((double)2.0, oct) * onept);
>
>I understand this code, but why is 'onept' necessary? Isn't MIDI
>based on A->440? Anyway, my real question is one of mathematics.
>I would like to have the ability in my prospective utility to translate
>the natural frequency in the other direction; that is, to convert
>a Hertz value to (basenote, detune). The thing that is tough for me
>is reverse engineering the call to pow(). natcps = 2^oct, but then
>how does one solve for oct? The word logarithm is seeping in from
>high school memories, but they are to vague to be of any help to me.
>
>Thanks,
>
>Toby
>
> -There otta be a law-
>
>~
>~
>~
>~
>~
Received: from stork.maths.bath.ac.uk by omphalos.maths.Bath.AC.UK id aa05940;
13 Aug 98 15:06 BST
Received: from mercury.bath.ac.uk by stork.maths.Bath.AC.UK id aa02162;
13 Aug 98 15:05 BST
Received: (qmail 5633 invoked from network); 13 Aug 1998 14:06:02 -0000
Received: from hermes.ex.ac.uk (HELO exeter.ac.uk) (144.173.6.14)
by mercury.bath.ac.uk with SMTP; 13 Aug 1998 14:06:02 -0000
Received: from noether [144.173.8.10] by hermes via SMTP (PAA27773); Thu, 13 Aug 1998 15:02:50 +0100 (BST)
Received: from exeter.ac.uk by maths.ex.ac.uk; Thu, 13 Aug 1998 15:02:38 +0100
Received: from jaguars-int.cableinet.net [193.38.113.9] by hermes via SMTP (PAA23122); Thu, 13 Aug 1998 15:02:38 +0100 (BST)
Received: (qmail 7286 invoked from network); 13 Aug 1998 12:54:18 -0000
Received: from unknown (HELO cableinet.co.uk) (194.117.146.52)
by jaguars with SMTP; 13 Aug 1998 12:54:18 -0000
Message-ID: <35D2F00A.B2C177FB@cableinet.co.uk>
Date: Thu, 13 Aug 1998 14:54:18 +0100
From: Richard Dobson
Organization: Composers Desktop project
X-Mailer: Mozilla 4.04 [en] (Win95; I)
MIME-Version: 1.0
To: "Ruston, Paul"
CC: 'Csound group'
Subject: Re: Modifying AIFF soundfile information...
References: <98Aug13.091931edt.20624@fw.osler.com>
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Sender: owner-csound-outgoing@maths.ex.ac.uk
Precedence: bulk
Sorry to quibble, but I find these things very important!
386c is a pure major third, indeed, but A to C is a minor third.
So the correct numbers would be C = 523.252, A = 440 in equal temperament. The
ratio for the pure minor third is 6/5, = 316c, which would put C at 528Hz. Much
better!
Richard Dobson
Ruston, Paul wrote:
>
> I doubt if this is what you need exactly but if your math skills are any
> better than mine, you may be able to adapt it to your purposes.
>
> To calculate the size of a ratio (interval) in cents:
>
> 1200 x log2 (f 1 / f 2) = size in cents (where f 1 represents the
> largest component of the ratio). "f" could also be expressed as two
> actual "f"requencies.
>
> e.g. 1200 x log2 ( 5 / 4 ) = 386 cents
> or
> 1200 x log2 (550 Hz / 440 Hz) = 386 cents (A to C expressed as a pure
> major 3rd)
>
> I think you would then need to have something that converts cents to
> 'oct', which shouldn't be too hard. However, I never use 'oct' so I
> have no further suggestions. (Is this what you're looking for at
> all???)
>
> Paul Ruston
> >-----Original Message-----
> >From: Tobiah [SMTP:toby@rcsreg.com]
> >Sent: August 13, 1998 1:12 AM
> >To: Csound Mailing List; toby@rcsreg.com
> >Subject: Modifying AIFF soundfile information...
> >
> >I have it in mind to write a utility with which one can modify the
> >base frequency of an AIFF file. With this capability, it will be
> >an easier task to make banks of samples for loscil to read.
> >
> >Firstly, does anybody know of such a utility or application? I am
> >looking forward to writing the program, but would rather use an
> >existing one. By the way, there is an excellent sound editor for
> >UNIX called 'DAP' which has a really nice interface for auditioning
> >and setting the loop points in an AIFF file. See Dave Phillips' page.
> >
> >Second, there is a bit of code in 'aiff.c' that calculates the raw
> >Hz value of an AIFF sample from the 'baseNote' and 'detune' values
> >in its InstrumentChunk. This is used by sndinfo to report the raw
> >frequency, which is not otherwise stored in the AIFF file. Here is
> >the code:
> >
> >
> >double onept = 1.021975; /* A440 tuning factor */
> >
> > oct = (instr.baseNote + instr.detune/100.) / 12. + 3.;
> > adp->natcps = (float)(pow((double)2.0, oct) * onept);
> >
> >I understand this code, but why is 'onept' necessary? Isn't MIDI
> >based on A->440? Anyway, my real question is one of mathematics.
> >I would like to have the ability in my prospective utility to translate
> >the natural frequency in the other direction; that is, to convert
> >a Hertz value to (basenote, detune). The thing that is tough for me
> >is reverse engineering the call to pow(). natcps = 2^oct, but then
> >how does one solve for oct? The word logarithm is seeping in from
> >high school memories, but they are to vague to be of any help to me.
> >
> >Thanks,
> >
> >Toby
> >
> > -There otta be a law-
> >
> >~
> >~
> >~
> >~
> >~
Received: from stork.maths.bath.ac.uk by omphalos.maths.Bath.AC.UK id aa06404;
13 Aug 98 17:46 BST
Received: from mercury.bath.ac.uk by stork.maths.Bath.AC.UK id aa13969;
13 Aug 98 17:46 BST
Received: (qmail 13883 invoked from network); 13 Aug 1998 16:46:33 -0000
Received: from hermes.ex.ac.uk (HELO exeter.ac.uk) (144.173.6.14)
by mercury.bath.ac.uk with SMTP; 13 Aug 1998 16:46:33 -0000
Received: from noether [144.173.8.10] by hermes via SMTP (RAA16483); Thu, 13 Aug 1998 17:41:47 +0100 (BST)
Received: from exeter.ac.uk by maths.ex.ac.uk; Thu, 13 Aug 1998 17:41:37 +0100
Received: from root@ax-nicb.axnet.it [194.184.60.149] by hermes via ESMTP (RAA17440); Thu, 13 Aug 1998 17:41:34 +0100 (BST)
Received: (from nicb@localhost)
by ax-nicb.axnet.it (8.8.8/8.8.8) id SAA22323;
Thu, 13 Aug 1998 18:41:10 +0200
Date: Thu, 13 Aug 1998 18:41:08 +0200 (MET DST)
From: Nicola Bernardini
To: Csound mailing list
Subject: missing aifc stuff
Message-ID:
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
Sender: owner-csound-outgoing@maths.ex.ac.uk
Precedence: bulk
In sfheader.c of the current csound_src.zip (3.484) sources, there are the
following references:
sfheader.c:99:extern void aifcReadHeader(int,char *,HEADATA *,long,SOUNDIN *);
sfheader.c:102:extern int is_aiff_formtype(int), is_aifc_formtype(int);
sfheader.c:122: else if (is_aifc_formtype(ifd)) { /* if AIFC form */
sfheader.c:123: aifcReadHeader(ifd,sfname,hdp,headfirstlong,p); /* read hdr.. */
sfheader.c:310:extern void aifcWriteHdr(int, int, int, double);
sfheader.c:327: aifcWriteHdr(ofd,O.outsampsiz,nchnls,esr);
sfheader.c:417:extern void aifcReWriteHdr(int, long);
sfheader.c:428: aifcReWriteHdr(ofd, datasize);
but aifcReadHeader(), is_aifc_formtype(), etc. are not defined anywhere
in the sources. So the application does not link.
Am I missing something?
Nicola
------------------------------------------------------------------------
Nicola Bernardini
E-mail: nicb@axnet.it
Re graphics: A picture is worth 10K words -- but only those to describe
the picture. Hardly any sets of 10K words can be adequately described
with pictures.
Received: from stork.maths.bath.ac.uk by omphalos.maths.Bath.AC.UK id aa06553;
13 Aug 98 18:55 BST
Received: from mercury.bath.ac.uk by stork.maths.Bath.AC.UK id aa18430;
13 Aug 98 18:55 BST
Received: (qmail 17518 invoked from network); 13 Aug 1998 17:55:44 -0000
Received: from hermes.ex.ac.uk (HELO exeter.ac.uk) (144.173.6.14)
by mercury.bath.ac.uk with SMTP; 13 Aug 1998 17:55:44 -0000
Received: from noether [144.173.8.10] by hermes via SMTP (SAA12030); Thu, 13 Aug 1998 18:52:03 +0100 (BST)
Received: from exeter.ac.uk by maths.ex.ac.uk; Thu, 13 Aug 1998 18:51:49 +0100
Received: from ella.mills.edu [144.91.3.20] by hermes via SMTP (SAA14638); Thu, 13 Aug 1998 18:51:46 +0100 (BST)
Received: (qmail 16075 invoked by uid 1964); 13 Aug 1998 10:51:20 -0700
Date: Thu, 13 Aug 1998 10:51:20 -0700 (PDT)
From: "Matt J. Ingalls"
To: Nicola Bernardini
cc: Csound mailing list
Subject: Re: missing aifc stuff
In-Reply-To:
Message-ID:
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
Sender: owner-csound-outgoing@maths.ex.ac.uk
Precedence: bulk
the funcs are in aifc.c
matt
Received: from stork.maths.bath.ac.uk by omphalos.maths.Bath.AC.UK id aa06611;
13 Aug 98 19:35 BST
Received: from pat.bath.ac.uk by stork.maths.Bath.AC.UK id aa20822;
13 Aug 98 19:35 BST
Received: (qmail 10345 invoked from network); 13 Aug 1998 18:35:34 -0000
Received: from hermes.ex.ac.uk (HELO exeter.ac.uk) (144.173.6.14)
by pat.bath.ac.uk with SMTP; 13 Aug 1998 18:35:34 -0000
Received: from noether [144.173.8.10] by hermes via SMTP (TAA13709); Thu, 13 Aug 1998 19:31:54 +0100 (BST)
Received: from exeter.ac.uk by maths.ex.ac.uk; Thu, 13 Aug 1998 19:31:44 +0100
Received: from theory.esm.rochester.edu [128.151.209.55] by hermes via SMTP (TAA16855); Thu, 13 Aug 1998 19:31:43 +0100 (BST)
Received: by theory.esm.rochester.edu (NX5.67e/NX3.0M)
id AA05568; Thu, 13 Aug 98 14:31:47 -0400
Date: Thu, 13 Aug 98 14:31:47 -0400
From: Jim Croson
Message-Id: <9808131831.AA05568@theory.esm.rochester.edu>
To: csound@maths.ex.ac.uk
Subject: aifc in csound.src.zip
Sender: owner-csound-outgoing@maths.ex.ac.uk
Precedence: bulk
Greetings,
The 3484 csound.src.zip has no aifc.c (or aifc.h, for that matter).
Also missing (but referenced in the makefile) is fhtfun.c.
All of the physical modeling opcodes are missing from
the makefile (but they are in the distribution).
And where, oh where is the mail list archive?
Jim Croson
croson@theory.esm.rochester.edu |