Csound Csound-dev Csound-tekno Search About

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

Date2023-08-28 10:44
FromPhilipp Neumann
Subject[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
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Date2023-08-28 10:55
FromMaximilian Marcoll
SubjectRe: [Csnd] extracting the decimal place of a pch-unit
Hi!

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

Cheers

M

________________________________

Prof. Maximilian Marcoll
Studio Director
Studio for Electroacoustic Music (SEAM)
University of Music Franz Liszt Weimar
Bauhaus University Weimar



On Aug 28, 2023, at 11:45, Philipp Neumann <kontakt@philippneumann.eu> wrote:

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
       https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Date2023-08-28 10:56
FromJohn ff
SubjectRe: [Csnd] extracting the decimal place of a pch-unit
Do int and frac help? 

⁣Get TypeApp for Android ​

On 28 Aug 2023, 10:46, at 10:46, Philipp Neumann  wrote:
>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
>        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

Date2023-08-28 10:57
FromPhilipp Neumann
SubjectRe: [Csnd] extracting the decimal place of a pch-unit
Incredibly simple and useful! Thanks!

> Am 28.08.2023 um 11:55 schrieb Maximilian Marcoll :
> 
> Hi! 
> 
> Convert to int and substract that value from your original one to get only the fractional part. 
> 
> Cheers
> 
> M
> 
> ________________________________
> 
> Prof. Maximilian Marcoll
> Studio Director
> Studio for Electroacoustic Music (SEAM)
> University of Music Franz Liszt Weimar
> Bauhaus University Weimar
> 
> http://seam.hfm-weimar.de
> 
> 
>> On Aug 28, 2023, at 11:45, Philipp Neumann  wrote:
>> 
>> 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
>>        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

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