Csound Csound-dev Csound-tekno Search About

Re: [Cs-dev] per-event input/output

Date2007-12-17 20:38
FromMichael Gogins
SubjectRe: [Cs-dev] per-event input/output
Probably, the situation is better with the double-precision sample version of Csound.

Regards,
Mike

-----Original Message-----
>From: Jonatan Liljedahl 
>Sent: Dec 17, 2007 2:31 PM
>To: Developer discussions 
>Subject: Re: [Cs-dev] per-event input/output
>
>Jonatan Liljedahl wrote:
>> matt ingalls wrote:
>> ...
>>> btw, i have used "fractional" i statements for this kind of thing before:
>>>
>>> i 2.3847 0 10 .
>>> i 2.3848 +
>>> i 2.3849 +
>>>
>>> instr 2
>>>    outvalue "id", p1
>>>    k1 ...something
>>>    outvalue "value", k1
>>> endif
>>>
>>>
>>> if i am not missing something, 
>>> i don't think you could use the software bus to do something like this!!
>> 
>> It worked fine! Here's an example of a graphical score with amplitude
>> envelope plotting for each event. (attached PDF)
>> 
>> Thanks for your help.
>
>There's still one problem... Instrument tags is encoded as the
>fractional part of p1, but since it's a simple 32-bit float there's a
>lot of problems with rounding errors, see this example:
>
>int main(void) {
>    float f;
>    int last = 9999;
>    for(f=1;f<2;f+=0.0001) {
>        int i = 0.5 + f * 10000;
>        printf("%d %g %f ",i,f,f);
>        if(i!=last+1) printf("ERROR!\n");
>        else printf("OK\n");
>        last=i;
>    }
>}
>
>$ foo | grep -B 1 ERROR
>13013 1.30135 1.301350 OK
>13015 1.30145 1.301450 ERROR!
>--
>19040 1.90405 1.904050 OK
>19042 1.90415 1.904150 ERROR!
>
>Which means that with tags from .0001 to .9999 there's two numbers that
>can't be represented? And then one can only have 9998 tagged events,
>increasing it to one more decimal gives 136 errors.
>
>Is there a way to tag instrument with strings instead? is there a way to
>send string p-args with csoundScoreEvent()?
>
>-- 
>/Jonatan         [ http://kymatica.com ]
>
>-------------------------------------------------------------------------
>SF.Net email is sponsored by:
>Check out the new SourceForge.net Marketplace.
>It's the best place to buy or sell services
>for just about anything Open Source.
>http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
>_______________________________________________
>Csound-devel mailing list
>Csound-devel@lists.sourceforge.net
>https://lists.sourceforge.net/lists/listinfo/csound-devel




-------------------------------------------------------------------------
SF.Net email is sponsored by:
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services
for just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net