[Csnd] k-rate cps to pch conversion

Hey hey,
I was looking for a k-rate cps to pch converter. The only two opcodes that I could find were cps2pch and cpsxpch and they apparently only work at i-time.

oct fractions can easily be scaled to pch fractional range, but it is interesting. Is there a good reason for it?

Best wishes and thanks,

Jeanette

Like Dave, I usually prefer other tunings, but if 12-equal is your goal, there’s no need for a lookup table:

ibase = cpspch(0.00)
koct = int(kPch)
kpc = frac(kPch)*100
kfreq = ibase*2^(koct+kpc/12)

Bill

Hey hey,
I was looking for a k-rate cps to pch converter. The only two opcodes that I could find were cps2pch and cpsxpch and they apparently only work at i-time.

oct fractions can easily be scaled to pch fractional range, but it is interesting. Is there a good reason for it?

Best wishes and thanks,

Jeanette

--
* Website: http://juliencoder.de - for summer is a state of sound
* Youtube: jeanette_c - YouTube
* Audiobombs: Jeanette C.
* GitHub: jeanette-c · GitHub

Baby, take the time to realize
I'm not the kind to sacrifice <3
(Britney Spears)

Csound mailing list
Csound@listserv.heanet.ie
LISTSERV 16.5 - CSOUND List at LISTSERV.HEANET.IE
Send bugs reports to
      Issues · csound/csound · GitHub
Discussions of bugs and features can be posted here

Bill Alves
Professor of Music, The Claremont Colleges
Harvey Mudd College
301 Platt Blvd. Claremont CA 91711
http://pages.hmc.edu/alves/
http://www.billalves.com/

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