Csound Csound-dev Csound-tekno Search About

[Csnd] how to enter rests in csound scores

Date2024-01-06 09:31
FromStefan Thomas
Subject[Csnd] how to enter rests in csound scores
Dear community,
I would like to know how to enter rests in Csound as conveniently as possible.
I normally use the python programming language for my purposes, for example:
durs = [1, 1, 0.5, 0.5, 3],split()
To get the start times for the events I use a function created by myself:
start = 0
beats = addtimes(durs,start)
The result will be:
[0, 1.0, 2.0, 2.5, 3.0, 6.0]
But how could I handle rests? What if the durations looked like this:
durs =[1,1,0.5,3]
But the Beats should be:
[0,1,2.5,3.0,6.0]
How do you deal with such difficulties?
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

Date2024-01-06 17:43
FromST Music
SubjectRe: [Csnd] how to enter rests in csound scores
Hi Stefan,
   without a better understanding of your code (ex. are you using a schedule/event to trigger notes/samples? ) then one solution might be to use gating or perhaps a "ghost note" (amplitude of 0) as a placeholder for the rest. 

For example, if you have:
  durs =  [0, 1.0, 2.0, 2.5, 3.0, 6.0, 7.0]
  amps = [1, 1, 1, 1, 1, 0]
then 7.0 would be a silent/ghost note which would serve as a rest. Gating would offer the benefit of controlling not only the start time of each note but also the duration, which would also allow rests, but would be slightly more involved.

Best,
Scott

On Sat, Jan 6, 2024, 4:31 a.m. Stefan Thomas <kontrapunktstefan@gmail.com> wrote:
Dear community,
I would like to know how to enter rests in Csound as conveniently as possible.
I normally use the python programming language for my purposes, for example:
durs = [1, 1, 0.5, 0.5, 3],split()
To get the start times for the events I use a function created by myself:
start = 0
beats = addtimes(durs,start)
The result will be:
[0, 1.0, 2.0, 2.5, 3.0, 6.0]
But how could I handle rests? What if the durations looked like this:
durs =[1,1,0.5,3]
But the Beats should be:
[0,1,2.5,3.0,6.0]
How do you deal with such difficulties?
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