Csound Csound-dev Csound-tekno Search About

CsoundAPI new scorelines

Date2016-05-24 00:21
FromForrest Curo
SubjectCsoundAPI new scorelines
If I understand the examples, they show how to add events to a score with CsoundReadScore, feed that to an instance of csound with csoundStart -- and optionally send in control signals while that's running.

Sending a running instance new score lines isn't shown; and I haven't found an API function for that. (?)

csoundSetOption(csound, "-L testfif"); doesn't do it; that compiles but crashes on startup from failure to open my fifo.

Should the c program using the API open the fifo for reading first?

Is there a more direct method I've missed?


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

Date2016-05-24 00:28
FromMichael Gogins
SubjectRe: CsoundAPI new scorelines
csoundReadScore does what you want. The time is relative to the time
that function is called.

Regards,
Mike

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


On Mon, May 23, 2016 at 7:21 PM, Forrest Curo  wrote:
> If I understand the examples, they show how to add events to a score with
> CsoundReadScore, feed that to an instance of csound with csoundStart -- and
> optionally send in control signals while that's running.
>
> Sending a running instance new score lines isn't shown; and I haven't found
> an API function for that. (?)
>
> csoundSetOption(csound, "-L testfif"); doesn't do it; that compiles but
> crashes on startup from failure to open my fifo.
>
> Should the c program using the API open the fifo for reading first?
>
> Is there a more direct method I've missed?
>
>
> 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

Date2016-05-24 00:29
FromMichael Gogins
SubjectRe: CsoundAPI new scorelines
I should add, csoundInputMessage also does that, but uses the same
code internally as csoundReadScore.

MKG

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


On Mon, May 23, 2016 at 7:28 PM, Michael Gogins
 wrote:
> csoundReadScore does what you want. The time is relative to the time
> that function is called.
>
> Regards,
> Mike
>
> -----------------------------------------------------
> Michael Gogins
> Irreducible Productions
> http://michaelgogins.tumblr.com
> Michael dot Gogins at gmail dot com
>
>
> On Mon, May 23, 2016 at 7:21 PM, Forrest Curo  wrote:
>> If I understand the examples, they show how to add events to a score with
>> CsoundReadScore, feed that to an instance of csound with csoundStart -- and
>> optionally send in control signals while that's running.
>>
>> Sending a running instance new score lines isn't shown; and I haven't found
>> an API function for that. (?)
>>
>> csoundSetOption(csound, "-L testfif"); doesn't do it; that compiles but
>> crashes on startup from failure to open my fifo.
>>
>> Should the c program using the API open the fifo for reading first?
>>
>> Is there a more direct method I've missed?
>>
>>
>> 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

Date2016-05-24 00:53
FromForrest Curo
SubjectRe: CsoundAPI new scorelines
I don't know why this clobbers my sound:
    while (csoundPerformKsmps(csound) == 0) {
    sco = "i1 0 1 0.5 8.05\n";
    csoundReadScore(csound, sco);
    sleep(10);
  
    }

but at 10 second intervals I am getting lines like so:
SECTION 1:
  rtevent:       T  0.001 TT  0.001 M:  0.00000  0.00000
  rtevent:       T  0.001 TT  0.001 M:  0.00228  0.00228
  rtevent:       T  0.002 TT  0.002 M:  0.00284  0.00284
  rtevent:       T  0.003 TT  0.003 M:  0.00721  0.00721
  rtevent:       T  0.004 TT  0.004 M:  0.02342  0.02342
  rtevent:       T  0.004 TT  0.004 M:  0.02364  0.02364
  rtevent:       T  0.005 TT  0.005 M:  0.02859  0.02859
  rtevent:       T  0.006 TT  0.006 M:  0.01962  0.01962
  rtevent:       T  0.007 TT  0.007 M:  0.04437  0.04437
  rtevent:       T  0.007 TT  0.007 M:  0.04554  0.04554
...

On Mon, May 23, 2016 at 4:29 PM, Michael Gogins <michael.gogins@gmail.com> wrote:
I should add, csoundInputMessage also does that, but uses the same
code internally as csoundReadScore.

MKG

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


On Mon, May 23, 2016 at 7:28 PM, Michael Gogins
<michael.gogins@gmail.com> wrote:
> csoundReadScore does what you want. The time is relative to the time
> that function is called.
>
> Regards,
> Mike
>
> -----------------------------------------------------
> Michael Gogins
> Irreducible Productions
> http://michaelgogins.tumblr.com
> Michael dot Gogins at gmail dot com
>
>
> On Mon, May 23, 2016 at 7:21 PM, Forrest Curo <treegestalt@gmail.com> wrote:
>> If I understand the examples, they show how to add events to a score with
>> CsoundReadScore, feed that to an instance of csound with csoundStart -- and
>> optionally send in control signals while that's running.
>>
>> Sending a running instance new score lines isn't shown; and I haven't found
>> an API function for that. (?)
>>
>> csoundSetOption(csound, "-L testfif"); doesn't do it; that compiles but
>> crashes on startup from failure to open my fifo.
>>
>> Should the c program using the API open the fifo for reading first?
>>
>> Is there a more direct method I've missed?
>>
>>
>> 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

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

Date2016-05-24 01:20
FromMichael Gogins
SubjectRe: CsoundAPI new scorelines
Because on every kperiod, you are playing the same note. These methods
are thread-safe. Call csoundReadScore from a different thread,
whenever you want to play a note or group of notes.

Regards,
Mike

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


On Mon, May 23, 2016 at 7:53 PM, Forrest Curo  wrote:
> I don't know why this clobbers my sound:
>     while (csoundPerformKsmps(csound) == 0) {
>     sco = "i1 0 1 0.5 8.05\n";
>     csoundReadScore(csound, sco);
>     sleep(10);
>
>     }
>
> but at 10 second intervals I am getting lines like so:
> SECTION 1:
>   rtevent:       T  0.001 TT  0.001 M:  0.00000  0.00000
>   rtevent:       T  0.001 TT  0.001 M:  0.00228  0.00228
>   rtevent:       T  0.002 TT  0.002 M:  0.00284  0.00284
>   rtevent:       T  0.003 TT  0.003 M:  0.00721  0.00721
>   rtevent:       T  0.004 TT  0.004 M:  0.02342  0.02342
>   rtevent:       T  0.004 TT  0.004 M:  0.02364  0.02364
>   rtevent:       T  0.005 TT  0.005 M:  0.02859  0.02859
>   rtevent:       T  0.006 TT  0.006 M:  0.01962  0.01962
>   rtevent:       T  0.007 TT  0.007 M:  0.04437  0.04437
>   rtevent:       T  0.007 TT  0.007 M:  0.04554  0.04554
> ...
>
> On Mon, May 23, 2016 at 4:29 PM, Michael Gogins 
> wrote:
>>
>> I should add, csoundInputMessage also does that, but uses the same
>> code internally as csoundReadScore.
>>
>> MKG
>>
>> -----------------------------------------------------
>> Michael Gogins
>> Irreducible Productions
>> http://michaelgogins.tumblr.com
>> Michael dot Gogins at gmail dot com
>>
>>
>> On Mon, May 23, 2016 at 7:28 PM, Michael Gogins
>>  wrote:
>> > csoundReadScore does what you want. The time is relative to the time
>> > that function is called.
>> >
>> > Regards,
>> > Mike
>> >
>> > -----------------------------------------------------
>> > Michael Gogins
>> > Irreducible Productions
>> > http://michaelgogins.tumblr.com
>> > Michael dot Gogins at gmail dot com
>> >
>> >
>> > On Mon, May 23, 2016 at 7:21 PM, Forrest Curo 
>> > wrote:
>> >> If I understand the examples, they show how to add events to a score
>> >> with
>> >> CsoundReadScore, feed that to an instance of csound with csoundStart --
>> >> and
>> >> optionally send in control signals while that's running.
>> >>
>> >> Sending a running instance new score lines isn't shown; and I haven't
>> >> found
>> >> an API function for that. (?)
>> >>
>> >> csoundSetOption(csound, "-L testfif"); doesn't do it; that compiles but
>> >> crashes on startup from failure to open my fifo.
>> >>
>> >> Should the c program using the API open the fifo for reading first?
>> >>
>> >> Is there a more direct method I've missed?
>> >>
>> >>
>> >> 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
>
>
> 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

Date2016-05-24 01:51
FromForrest Curo
SubjectRe: CsoundAPI new scorelines
Okay, thanks!

It _is_ "csoundPerform - K - smps" after all! That's a ten second wait between each k cycle, now that I finally think about it...

No wonder that messing with that loop kept giving me weird problems!

On Mon, May 23, 2016 at 5:20 PM, Michael Gogins <michael.gogins@gmail.com> wrote:
Because on every kperiod, you are playing the same note. These methods
are thread-safe. Call csoundReadScore from a different thread,
whenever you want to play a note or group of notes.

Regards,
Mike

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


On Mon, May 23, 2016 at 7:53 PM, Forrest Curo <treegestalt@gmail.com> wrote:
> I don't know why this clobbers my sound:
>     while (csoundPerformKsmps(csound) == 0) {
>     sco = "i1 0 1 0.5 8.05\n";
>     csoundReadScore(csound, sco);
>     sleep(10);
>
>     }
>
> but at 10 second intervals I am getting lines like so:
> SECTION 1:
>   rtevent:       T  0.001 TT  0.001 M:  0.00000  0.00000
>   rtevent:       T  0.001 TT  0.001 M:  0.00228  0.00228
>   rtevent:       T  0.002 TT  0.002 M:  0.00284  0.00284
>   rtevent:       T  0.003 TT  0.003 M:  0.00721  0.00721
>   rtevent:       T  0.004 TT  0.004 M:  0.02342  0.02342
>   rtevent:       T  0.004 TT  0.004 M:  0.02364  0.02364
>   rtevent:       T  0.005 TT  0.005 M:  0.02859  0.02859
>   rtevent:       T  0.006 TT  0.006 M:  0.01962  0.01962
>   rtevent:       T  0.007 TT  0.007 M:  0.04437  0.04437
>   rtevent:       T  0.007 TT  0.007 M:  0.04554  0.04554
> ...
>
> On Mon, May 23, 2016 at 4:29 PM, Michael Gogins <michael.gogins@gmail.com>
> wrote:
>>
>> I should add, csoundInputMessage also does that, but uses the same
>> code internally as csoundReadScore.
>>
>> MKG
>>
>> -----------------------------------------------------
>> Michael Gogins
>> Irreducible Productions
>> http://michaelgogins.tumblr.com
>> Michael dot Gogins at gmail dot com
>>
>>
>> On Mon, May 23, 2016 at 7:28 PM, Michael Gogins
>> <michael.gogins@gmail.com> wrote:
>> > csoundReadScore does what you want. The time is relative to the time
>> > that function is called.
>> >
>> > Regards,
>> > Mike
>> >
>> > -----------------------------------------------------
>> > Michael Gogins
>> > Irreducible Productions
>> > http://michaelgogins.tumblr.com
>> > Michael dot Gogins at gmail dot com
>> >
>> >
>> > On Mon, May 23, 2016 at 7:21 PM, Forrest Curo <treegestalt@gmail.com>
>> > wrote:
>> >> If I understand the examples, they show how to add events to a score
>> >> with
>> >> CsoundReadScore, feed that to an instance of csound with csoundStart --
>> >> and
>> >> optionally send in control signals while that's running.
>> >>
>> >> Sending a running instance new score lines isn't shown; and I haven't
>> >> found
>> >> an API function for that. (?)
>> >>
>> >> csoundSetOption(csound, "-L testfif"); doesn't do it; that compiles but
>> >> crashes on startup from failure to open my fifo.
>> >>
>> >> Should the c program using the API open the fifo for reading first?
>> >>
>> >> Is there a more direct method I've missed?
>> >>
>> >>
>> >> 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
>
>
> 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

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