Csound Csound-dev Csound-tekno Search About

i Statement P3 Samples Instead of Seconds

Date2017-01-19 05:28
FromEmmett Palaima
Subjecti Statement P3 Samples Instead of Seconds
Hi, is there any way to trigger an instrument with a score statement that defines the instrument duration in samples rather than seconds? Working on a project that could use something like this, it would be much more convenient than having to do the calculation every time. 

Thanks!
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

Date2017-01-19 06:34
FromVictor Lazzarini
SubjectRe: i Statement P3 Samples Instead of Seconds
yes, the simplest way is to do this in your
instrument:

p3 /= sr

and then set your duration. It will be rounded up to ksmps multiples, but if you use --sample-accurate it should be correct to the
sample.

Victor Lazzarini
Dean of Arts, Celtic Studies, and Philosophy
Maynooth University
Ireland

On 19 Jan 2017, at 05:28, Emmett Palaima <epalaima@BERKLEE.EDU> wrote:

Hi, is there any way to trigger an instrument with a score statement that defines the instrument duration in samples rather than seconds? Working on a project that could use something like this, it would be much more convenient than having to do the calculation every time. 

Thanks!
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