Csound Csound-dev Csound-tekno Search About

Re: [Csnd] Is it possible to know the time until the next note?

Date2014-05-11 02:30
FromAlex Soundbwoy2step
SubjectRe: [Csnd] Is it possible to know the time until the next note?
Do You want to use it live? ;)

Michael Saunders  schrieb:

>I have an instrument that needs to know the start time of the next note.
> Is there any way of finding this?  I think it should be easy, but it seems
>to be impossible.
>
>The obvious thing to do is to use np in the score, but this is no good
>since the times in the score are in beats and the times in instruments are
>in seconds and the instrument cannot convert beats into seconds because it
>cannot know the value of tempo at past and future times.
>
>Using np would work if it were calculated after the Tempo pass (then it
>would be in seconds), but it is calculated before the Tempo pass (and
>remains in beats).  I'm told that this cannot be changed, though I can't
>see what use unconvertable beats are to anyone at performance time, where
>all other time measures are in seconds.
>
>The manual originally said that np (and pp and +) were calculated after the
>Tempo pass, and I think that the writer of the original entry had the right
>idea.  Csound though, apparently, had never worked that way and so the
>manual was recently changed to reflect the behavior of the code.  I think
>that behavior, though, is useless.
>
>So,
>1. Is there a simple way for an instrument to know the time, in seconds,
>until the next note (remembering that the tempo might vary with time)?
>2. If it is impossible to place the calculation of pp, np, and + after the
>Tempo pass, could we have something exactly like them that _is_ calculated
>after Tempo?
>
>Here is an example:
>
>instr 11
>print p2, p3
>print p4, p5
>endin
>
>t0 100
>i11 1 2 np2 np3
>i11 2 3 pp2 pp3
>
>results in the output:
>
>instr 11: p2 = 0.600 p3 = 1.200
>instr 11: p4 = 2.000 p5 = 3.000
>
>instr 11: p2 = 1.200 p3 = 1.800
>instr 11: p4 = 1.000 p5 = 2.000
>
>---p2 and p3 are in seconds; p4 and p5 are in units of beats which cannot,
>at this point, be converted into seconds, so they are meaningless to the
>instrument.  I would like the output to be like this:
>
>instr 11: p2 = 0.600 p3 = 1.200
>instr 11: p4 = 1.200 p5 = 1.800
>
>instr 11: p2 = 1.200 p3 = 1.800
>instr 11: p4 = 0.600 p5 = 1.200
>
>---everything within the instrument is in units of seconds.
>
>Send bugs reports to
>        https://github.com/csound/csound/issues
>Discussions of bugs and features can be posted here
>To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"
>
>
>

Date2014-05-11 02:33
FromMichael Saunders
SubjectRe: [Csnd] Is it possible to know the time until the next note?
No, I'm only concerned with playing scores.


On Sat, May 10, 2014 at 8:30 PM, Alex Soundbwoy2step <soundbwoy2step@gmail.com> wrote:
Do You want to use it live? ;)

Michael Saunders <odradek5@gmail.com> schrieb:

>I have an instrument that needs to know the start time of the next note.
> Is there any way of finding this?  I think it should be easy, but it seems
>to be impossible.
>
>The obvious thing to do is to use np in the score, but this is no good
>since the times in the score are in beats and the times in instruments are
>in seconds and the instrument cannot convert beats into seconds because it
>cannot know the value of tempo at past and future times.
>
>Using np would work if it were calculated after the Tempo pass (then it
>would be in seconds), but it is calculated before the Tempo pass (and
>remains in beats).  I'm told that this cannot be changed, though I can't
>see what use unconvertable beats are to anyone at performance time, where
>all other time measures are in seconds.
>
>The manual originally said that np (and pp and +) were calculated after the
>Tempo pass, and I think that the writer of the original entry had the right
>idea.  Csound though, apparently, had never worked that way and so the
>manual was recently changed to reflect the behavior of the code.  I think
>that behavior, though, is useless.
>
>So,
>1. Is there a simple way for an instrument to know the time, in seconds,
>until the next note (remembering that the tempo might vary with time)?
>2. If it is impossible to place the calculation of pp, np, and + after the
>Tempo pass, could we have something exactly like them that _is_ calculated
>after Tempo?
>
>Here is an example:
>
>instr 11
>print p2, p3
>print p4, p5
>endin
>
>t0 100
>i11 1 2 np2 np3
>i11 2 3 pp2 pp3
>
>results in the output:
>
>instr 11: p2 = 0.600 p3 = 1.200
>instr 11: p4 = 2.000 p5 = 3.000
>
>instr 11: p2 = 1.200 p3 = 1.800
>instr 11: p4 = 1.000 p5 = 2.000
>
>---p2 and p3 are in seconds; p4 and p5 are in units of beats which cannot,
>at this point, be converted into seconds, so they are meaningless to the
>instrument.  I would like the output to be like this:
>
>instr 11: p2 = 0.600 p3 = 1.200
>instr 11: p4 = 1.200 p5 = 1.800
>
>instr 11: p2 = 1.200 p3 = 1.800
>instr 11: p4 = 0.600 p5 = 1.200
>
>---everything within the instrument is in units of seconds.
>
>Send bugs reports to
>        https://github.com/csound/csound/issues
>Discussions of bugs and features can be posted here
>To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"
>
>
>

Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here
To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"