[Csnd] extracting the decimal place of a pch-unit

Hello everybody!

I want to use the decimal place of an incoming pch-note, so i can do calculations with these inside my instrument.

For example:
- i get an event by ‚pchmidi‘
- now i want to ignore the octave number and just use the position of the note in the octave, the decimal place
- i want to divide the length of a sample by 12, so the pch-note is defining the start point of the sample but it will be in every octave the same
  - e.g. 8.04 defines the same start position as 5.04

Has someone a idea for this?

Greetings,
Philipp

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

Hi!

Convert to int and substract that value from your original one to get only the fractional part.

Cheers

M

Do int and frac help?

⁣Get TypeApp for Android ​

Incredibly simple and useful! Thanks!