back to list

Cents in Csound

🔗mentalosmosis <mentalosmosis@...>

10/11/2004 11:46:37 PM

Hi there, I'm still dumb at csound, and I was wondering if there were
an easy way to write the notes in cents...

I just created a way of doing so, but I guess it's way more
complicated than it should, with lots of calculation and variables and
stuff...

I created a parameter for the note in cents, and another parameter for
the ocatve...

anyway, I was just approved and I'm studing microtonality for my
masters degree in composition at the Sao Paulo State University of
Campinas (UniCamp) here in Brazil...

cheers

🔗Daniel Wolf <djwolf1@...>

10/12/2004 2:09:42 AM

mentalosmosis wrote:

>
> Hi there, I'm still dumb at csound, and I was wondering if there were
> an easy way to write the notes in cents...
>
> I just created a way of doing so, but I guess it's way more
> complicated than it should, with lots of calculation and variables and
> stuff...

It's easy --- here's an excerpt from Bill Alves' article** Csound-based Microtonal Synthesis and Control with MIDI** in _The CSound Book_ cd:

*----
*

*Pitch Specification and Resolution in Csound*

Csound provides three different methods for pitch specification: /cps/ (frequency in Hertz, required by most functions), /pch/ (a twelve-tone equal temperament specification with microtones in cents) and /oct/ (a specification with decimal divisions of the octave). The /pch/ specification is most commonly used in score files to specify pitches. The number to the left of the decimal point represents the octave, with 8 being the octave beginning on middle C. The two digits immediately to the right of the decimal point represent the pitch class, that is, the key number within the octave for a standard piano keyboard, beginning with C=00.

Thus 8.00 is middle C, 8.01 is C# or Db, and so on, up to 8.11 which is B. 8.12 is equivalent to 9.00, or C of the next octave. The next two decimal points represent cents, that is, hundredths of equally-tempered semitones. Thus 8.0050 is a pitch halfway between C and C#, or 50 cents (a quarter-tone) sharp of C. In the /oct/ format, the numbers to the left of the decimal point, again, represent the octave, but the numbers to the right of the decimal point represent decimal divisions of the octave. Therefore, 8.06 (F#) in /pch/ notation is equivalent to 8.50 (halfway between the C of octave 8 and the C of octave 9) in /oct/ notation.

Csound provides six functions to convert between these specifications: *cpspch* (convert from pch to /cps/ in twelve-tone equal temperament), *cpsoct* (convert from oct to /cps/), *pchoct* (convert from /oct/ to /pch/), *pchcps* (convert from /cps/ to /pch/),*octcps* (convert from /cps/ to /oct/), and *octpch* (convert from /pch/ to /oct/).

While pitches in a score may be specified directly with /cps/, few musicians think in such terms. For composers who use twelve-tone equal temperament (12TET), or who know their pitches relationship to 12TET, /pch/ notation can be useful. For example, a quarter-tone scale could be rendered: 8.000, 8.005, 8.010, 8.015, 8.020, 8.025, and so on. However, many composers in alternate tunings have no desire to express themselves in relation to the 12TET reference.

The /oct/ specification would be mainly useful in equal temperaments easily represented in decimal format, such as 10TET or 100TET. John Fitch's /Drums and Different Canons #1/ is a work in 100TET that uses /oct/ format for all pitches. The complete orchestra and score for this piece is available on the CD-ROM accompanying this book.

Pitch resolution in Csound is generally very good (especially in comparison to most MIDI instruments), though the frequency output of analysis programs such as *hetro *and *pvanal* may be coarse. Frequencies in /cps/ format are represented by floating point variables in Csound, which on most systems means that the difference between 20 Hz and the next highest representable frequency is only about 0.00021cents.

----

🔗mentalosmosis <mentalosmosis@...>

10/12/2004 12:09:27 PM

I can't believe how dumb my teacher is... thank God I dumped my
graduation course... anyway, it's none of your business folks...

Thanks Daniel Wolf

one last thing, how accurate are the representations in cents?

Example, if I wanta tone of 133.333 cents in relation to C4, can I
just write 8.0133333 ? Just out of curiosity, cause I don't think I
can tell it by listening only...

cheers

--- In MakeMicroMusic@yahoogroups.com, Daniel Wolf <djwolf1@a...> wrote:
> mentalosmosis wrote:
>
> >
> > Hi there, I'm still dumb at csound, and I was wondering if there were
> > an easy way to write the notes in cents...
> >
> > I just created a way of doing so, but I guess it's way more
> > complicated than it should, with lots of calculation and variables and
> > stuff...
>
> It's easy --- here's an excerpt from Bill Alves' article**
Csound-based
> Microtonal Synthesis and Control with MIDI** in _The CSound Book_ cd:
>
> *----
> *
>
> *Pitch Specification and Resolution in Csound*
>
> Csound provides three different methods for pitch specification: /cps/
> (frequency in Hertz, required by most functions), /pch/ (a twelve-tone
> equal temperament specification with microtones in cents) and /oct/ (a
> specification with decimal divisions of the octave). The /pch/
> specification is most commonly used in score files to specify pitches.
> The number to the left of the decimal point represents the octave, with
> 8 being the octave beginning on middle C. The two digits immediately to
> the right of the decimal point represent the pitch class, that is, the
> key number within the octave for a standard piano keyboard, beginning
> with C=00.
>
> Thus 8.00 is middle C, 8.01 is C# or Db, and so on, up to 8.11 which is
> B. 8.12 is equivalent to 9.00, or C of the next octave. The next two
> decimal points represent cents, that is, hundredths of equally-tempered
> semitones. Thus 8.0050 is a pitch halfway between C and C#, or 50 cents
> (a quarter-tone) sharp of C. In the /oct/ format, the numbers to the
> left of the decimal point, again, represent the octave, but the numbers
> to the right of the decimal point represent decimal divisions of the
> octave. Therefore, 8.06 (F#) in /pch/ notation is equivalent to 8.50
> (halfway between the C of octave 8 and the C of octave 9) in /oct/
notation.
>
> Csound provides six functions to convert between these specifications:
> *cpspch* (convert from pch to /cps/ in twelve-tone equal temperament),
> *cpsoct* (convert from oct to /cps/), *pchoct* (convert from /oct/ to
> /pch/), *pchcps* (convert from /cps/ to /pch/),*octcps* (convert from
> /cps/ to /oct/), and *octpch* (convert from /pch/ to /oct/).
>
> While pitches in a score may be specified directly with /cps/, few
> musicians think in such terms. For composers who use twelve-tone equal
> temperament (12TET), or who know their pitches relationship to 12TET,
> /pch/ notation can be useful. For example, a quarter-tone scale
could be
> rendered: 8.000, 8.005, 8.010, 8.015, 8.020, 8.025, and so on. However,
> many composers in alternate tunings have no desire to express
themselves
> in relation to the 12TET reference.
>
> The /oct/ specification would be mainly useful in equal temperaments
> easily represented in decimal format, such as 10TET or 100TET. John
> Fitch's /Drums and Different Canons #1/ is a work in 100TET that uses
> /oct/ format for all pitches. The complete orchestra and score for this
> piece is available on the CD-ROM accompanying this book.
>
> Pitch resolution in Csound is generally very good (especially in
> comparison to most MIDI instruments), though the frequency output of
> analysis programs such as *hetro *and *pvanal* may be coarse.
> Frequencies in /cps/ format are represented by floating point variables
> in Csound, which on most systems means that the difference between
20 Hz
> and the next highest representable frequency is only about 0.00021cents.
>
> ----