Csound Csound-dev Csound-tekno Search About

[Cs-dev] Iterate score during performance?

Date2014-10-08 17:45
FromMichael Gogins
Subject[Cs-dev] Iterate score during performance?
AttachmentsNone  None  

Is there a way, using the Csound API, after Csound has started,  to iterate through all score events, beginning with the very first event and ending with the very last event, returning the values of each event's fields?

One use case is to draw a piano roll display of the score being performed, e.g. on an HTML canvas.

I understand that this would work only for already scheduled events. I also understand that only the first 3 fields have a fixed meaning.

Thanks,
Mike


Date2014-10-08 17:59
FromSteven Yi
SubjectRe: [Cs-dev] Iterate score during performance?
My first instinct is to say no, at least from what I remember last
time looking through that area of code. Pre-scheduled events end up
being processed and sorted, then written to disk.  At run time, the
file is open and events are read one event at a time, essentially
acting like a priority queue. Because the implementation depends on
reading from a file, it's not in memory and thus not something one can
iterate.

For realtime-events, even those that come in that are scheduled for
the future, those end up on a different, in-memory queue.  However, I
don't see any API methods for iterating those events either.

However, one possibility may be to add a Cscore callback. That should
actually work as a means to iterate through events as I think that
gets called after reading and processing score data, but before the
sorted data gets written to disk for use at runtime.  Perhaps that's
worth investigating, and Jim Hearon wrote a couple of articles on
using Cscore callbacks. [1] [2]

[1] - http://www.csounds.com/journal/issue16/InterfacingCscore.html
[2] - http://www.csounds.com/journal/issue17/InterfacingCscore2.html


On Wed, Oct 8, 2014 at 12:45 PM, Michael Gogins
 wrote:
> Is there a way, using the Csound API, after Csound has started,  to iterate
> through all score events, beginning with the very first event and ending
> with the very last event, returning the values of each event's fields?
>
> One use case is to draw a piano roll display of the score being performed,
> e.g. on an HTML canvas.
>
> I understand that this would work only for already scheduled events. I also
> understand that only the first 3 fields have a fixed meaning.
>
> Thanks,
> Mike
>
>
> ------------------------------------------------------------------------------
> Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer
> Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports
> Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper
> Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer
> http://pubads.g.doubleclick.net/gampad/clk?id=154622311&iu=/4140/ostg.clktrk
> _______________________________________________
> Csound-devel mailing list
> Csound-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-devel
>

------------------------------------------------------------------------------
Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer
Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports
Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper
Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer
http://pubads.g.doubleclick.net/gampad/clk?id=154622311&iu=/4140/ostg.clktrk
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2014-10-08 18:08
FromMichael Gogins
SubjectRe: [Cs-dev] Iterate score during performance?
AttachmentsNone  None  
Thanks for the info, I'll check Jim's articles.

Best,
Mike


-----------------------------------------------------
Michael Gogins
Irreducible Productions
http://michaelgogins.tumblr.com
Michael dot Gogins at gmail dot com

On Wed, Oct 8, 2014 at 12:59 PM, Steven Yi <stevenyi@gmail.com> wrote:
My first instinct is to say no, at least from what I remember last
time looking through that area of code. Pre-scheduled events end up
being processed and sorted, then written to disk.  At run time, the
file is open and events are read one event at a time, essentially
acting like a priority queue. Because the implementation depends on
reading from a file, it's not in memory and thus not something one can
iterate.

For realtime-events, even those that come in that are scheduled for
the future, those end up on a different, in-memory queue.  However, I
don't see any API methods for iterating those events either.

However, one possibility may be to add a Cscore callback. That should
actually work as a means to iterate through events as I think that
gets called after reading and processing score data, but before the
sorted data gets written to disk for use at runtime.  Perhaps that's
worth investigating, and Jim Hearon wrote a couple of articles on
using Cscore callbacks. [1] [2]

[1] - http://www.csounds.com/journal/issue16/InterfacingCscore.html
[2] - http://www.csounds.com/journal/issue17/InterfacingCscore2.html


On Wed, Oct 8, 2014 at 12:45 PM, Michael Gogins
<michael.gogins@gmail.com> wrote:
> Is there a way, using the Csound API, after Csound has started,  to iterate
> through all score events, beginning with the very first event and ending
> with the very last event, returning the values of each event's fields?
>
> One use case is to draw a piano roll display of the score being performed,
> e.g. on an HTML canvas.
>
> I understand that this would work only for already scheduled events. I also
> understand that only the first 3 fields have a fixed meaning.
>
> Thanks,
> Mike
>
>
> ------------------------------------------------------------------------------
> Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer
> Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports
> Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper
> Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer
> http://pubads.g.doubleclick.net/gampad/clk?id=154622311&iu=/4140/ostg.clktrk
> _______________________________________________
> Csound-devel mailing list
> Csound-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-devel
>

------------------------------------------------------------------------------
Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer
Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports
Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper
Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer
http://pubads.g.doubleclick.net/gampad/clk?id=154622311&iu=/4140/ostg.clktrk
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/csound-devel


Date2014-10-08 19:11
Fromjpff
SubjectRe: [Cs-dev] Iterate score during performance?

On Wed, 8 Oct 2014, Steven Yi wrote:

> My first instinct is to say no, at least from what I remember last
> time looking through that area of code. Pre-scheduled events end up
> being processed and sorted, then written to disk.  At run time, the
> file is open and events are read one event at a time, essentially
> acting like a priority queue. Because the implementation depends on
> reading from a file, it's not in memory and thus not something one can
> iterate.

Not in cs6.  The sorted score is held in memory in the CORFIL structure. 
There are no files used in csound except output audio and fout.

==John

------------------------------------------------------------------------------
Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer
Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports
Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper
Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer
http://pubads.g.doubleclick.net/gampad/clk?id=154622311&iu=/4140/ostg.clktrk
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2014-10-08 19:28
FromSteven Yi
SubjectRe: [Cs-dev] Iterate score during performance?
Ah, thanks for the correction!  Just to clarify, the score data for
the initial score events is still written out as text to the CORFIL,
and read back in line by line as previously?

On Wed, Oct 8, 2014 at 2:11 PM, jpff  wrote:
>
>
> On Wed, 8 Oct 2014, Steven Yi wrote:
>
>> My first instinct is to say no, at least from what I remember last
>> time looking through that area of code. Pre-scheduled events end up
>> being processed and sorted, then written to disk.  At run time, the
>> file is open and events are read one event at a time, essentially
>> acting like a priority queue. Because the implementation depends on
>> reading from a file, it's not in memory and thus not something one can
>> iterate.
>
> Not in cs6.  The sorted score is held in memory in the CORFIL structure.
> There are no files used in csound except output audio and fout.
>
> ==John
>
> ------------------------------------------------------------------------------
> Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer
> Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports
> Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper
> Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer
> http://pubads.g.doubleclick.net/gampad/clk?id=154622311&iu=/4140/ostg.clktrk
> _______________________________________________
> Csound-devel mailing list
> Csound-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-devel

------------------------------------------------------------------------------
Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer
Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports
Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper
Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer
http://pubads.g.doubleclick.net/gampad/clk?id=154622311&iu=/4140/ostg.clktrk
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2014-10-08 19:40
Fromjpff
SubjectRe: [Cs-dev] Iterate score during performance?

On Wed, 8 Oct 2014, Steven Yi wrote:

> Ah, thanks for the correction!  Just to clarify, the score data for
> the initial score events is still written out as text to the CORFIL,
> and read back in line by line as previously?
>

Yes; in Engine/scsort.c and associated files


------------------------------------------------------------------------------
Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer
Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports
Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper
Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer
http://pubads.g.doubleclick.net/gampad/clk?id=154622311&iu=/4140/ostg.clktrk
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2014-10-08 19:45
FromSteven Yi
SubjectRe: [Cs-dev] Iterate score during performance?
Fantastic, thanks again!

On Wed, Oct 8, 2014 at 2:40 PM, jpff  wrote:
>
>
> On Wed, 8 Oct 2014, Steven Yi wrote:
>
>> Ah, thanks for the correction!  Just to clarify, the score data for
>> the initial score events is still written out as text to the CORFIL,
>> and read back in line by line as previously?
>>
>
> Yes; in Engine/scsort.c and associated files
>
>
> ------------------------------------------------------------------------------
> Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer
> Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports
> Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper
> Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer
> http://pubads.g.doubleclick.net/gampad/clk?id=154622311&iu=/4140/ostg.clktrk
> _______________________________________________
> Csound-devel mailing list
> Csound-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-devel

------------------------------------------------------------------------------
Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer
Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports
Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper
Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer
http://pubads.g.doubleclick.net/gampad/clk?id=154622311&iu=/4140/ostg.clktrk
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net