[Csnd] Is it possible to know the time until the next note?
Date | 2014-05-11 01:23 |
From | Michael Saunders |
Subject | [Csnd] Is it possible to know the time until the next note? |
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.
|
Date | 2014-05-11 09:34 |
From | jpff@cs.bath.ac.uk |
Subject | [Csnd] Re: |
Attachments | None |