Csound Csound-dev Csound-tekno Search About

Re: [Csnd] code share: cpsmidinn_a432

Date2020-06-19 08:27
FromMikoláš Štrajt
SubjectRe: [Csnd] code share: cpsmidinn_a432
It's useful when:

- you need one instrument play A440 and another A432
- you need to switch mid-playing

--
Mikoláš


Is this ny different to setting A4 = 432 ?


On Thu, 18 Jun 2020, Mikoláš Štrajt wrote:

> Hi,
> I did some hunting in User-Defined Opcode Database and found UDO
> implementation of cpsmid opcode. See
> http://www.csounds.com/udo/displayOpcode.php?opcode_id=64
>
> I used this to create new cpsmidinn_a432 opcode as follows:
>
> opcode    cpsmidinn_a432, k, k
>     kmid    xin
>     #define MIDI2CPS(xmidi) # (432.0*exp(log(2.0)*(($xmidi)-69.0)/12.0)) #
>     kcps    =    $MIDI2CPS(kmid)
>     xout    kcps
> endop
>
> --
> Mikoláš 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
>

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