Csound Csound-dev Csound-tekno Search About

[Csnd] log of instrument calls

Date2020-07-27 02:12
FromForrest Curo
Subject[Csnd] log of instrument calls
How could I make a file listing all score lines (including rt score events via command-line -L) in a csound run?

Forrest Curo
San Diego

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

Date2020-07-27 08:49
From00000008a49663bc-dmarc-request@LISTSERV.HEANET.IE
SubjectRe: [Csnd] log of instrument calls
I'd try to let the instruments write the score/rt event they receive something like (not tested):

Instr X
S_event sprintf "i %f %f %f %f", p1, p2, p3, p4, p5
fprints "score.sco", S_event
;instrument code
;instrument code 
endin

Ciao

Stefano

> Il 27/07/2020 03:12 Forrest Curo  ha scritto:
> 
> 
> How could I make a file listing all score lines (including rt score events via command-line -L) in a csound run?
> 
> Forrest Curo
> San Diego
> 
> 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

Date2020-07-27 14:22
FromForrest Curo
SubjectRe: [Csnd] log of instrument calls
Ah! So with instruments that only get called by other instruments, I could just leave those lines out.

But in place of p2 in your example, you'd want to put the result of 'times':

times

times — Read absolute time in seconds.

Description

Read absolute time, in seconds, since the start of the performance.


On Mon, Jul 27, 2020 at 12:49 AM <00000008a49663bc-dmarc-request@listserv.heanet.ie> wrote:
I'd try to let the instruments write the score/rt event they receive something like (not tested):

Instr X
S_event sprintf "i %f %f %f %f", p1, p2, p3, p4, p5
fprints "score.sco", S_event
;instrument code
;instrument code
endin

Ciao

Stefano

> Il 27/07/2020 03:12 Forrest Curo <treegestalt@gmail.com> ha scritto:
>
>
> How could I make a file listing all score lines (including rt score events via command-line -L) in a csound run?
>
> Forrest Curo
> San Diego
>
> 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

Date2020-07-27 16:12
From00000008a49663bc-dmarc-request@LISTSERV.HEANET.IE
SubjectRe: [Csnd] log of instrument calls

Yes, only on instruments you activate. Times opcode make more sense than p2, you are right. Hope it works

Il 27/07/2020 15:22 Forrest Curo <treegestalt@gmail.com> ha scritto:


Ah! So with instruments that only get called by other instruments, I could just leave those lines out.

But in place of p2 in your example, you'd want to put the result of 'times':

times

times — Read absolute time in seconds.

Description

Read absolute time, in seconds, since the start of the performance.


On Mon, Jul 27, 2020 at 12:49 AM < 00000008a49663bc-dmarc-request@listserv.heanet.ie> wrote:
I'd try to let the instruments write the score/rt event they receive something like (not tested):

Instr X
S_event sprintf "i %f %f %f %f", p1, p2, p3, p4, p5
fprints "score.sco", S_event
;instrument code
;instrument code
endin

Ciao

Stefano

> Il 27/07/2020 03:12 Forrest Curo < treegestalt@gmail.com> ha scritto:
>
>
> How could I make a file listing all score lines (including rt score events via command-line -L) in a csound run?
>
> Forrest Curo
> San Diego
>
> 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

Date2020-07-27 21:02
FromForrest Curo
SubjectRe: [Csnd] log of instrument calls
And now (with a little copy & paste) I have playback! Can edit & (adding new instruments) accompany myself, whee!

ie
instr 1;     low notes of scale (degrees 1 & 2)
itim times
S_event sprintf "i %f %f %f %f %f\n", p1, itim, p3, p4, p5
fprints "score.sco", S_event
giscale[1] = p4;
giscale[2] = p5;
print giscale[1], giscale[2]
endin
=======
[score.sco]:

i 1.000000 0.000000 0.100000 2.000000 4.000000
i 1.000000 7.970249 0.100000 1.000000 2.000000
i 1.000000 8.759728 0.100000 1.000000 3.000000
i 1.000000 9.549206 0.100000 1.000000 4.000000
i 1.000000 10.361905 0.100000 2.000000 3.000000
i 1.000000 11.128163 0.100000 2.000000 4.000000
i 1.000000 12.103401 0.100000 3.000000 4.000000

On Sun, Jul 26, 2020 at 6:12 PM Forrest Curo <treegestalt@gmail.com> wrote:
How could I make a file listing all score lines (including rt score events via command-line -L) in a csound run?

Forrest Curo
San Diego

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

Date2020-07-27 21:31
FromForrest Curo
SubjectRe: [Csnd] log of instrument calls
Attachments52.mp3  
Some scale & timbre changes were GUied into the first run, others were added real-time during playback...

On Mon, Jul 27, 2020 at 1:02 PM Forrest Curo <treegestalt@gmail.com> wrote:
And now (with a little copy & paste) I have playback! Can edit & (adding new instruments) accompany myself, whee!

ie
instr 1;     low notes of scale (degrees 1 & 2)
itim times
S_event sprintf "i %f %f %f %f %f\n", p1, itim, p3, p4, p5
fprints "score.sco", S_event
giscale[1] = p4;
giscale[2] = p5;
print giscale[1], giscale[2]
endin
=======
[score.sco]:

i 1.000000 0.000000 0.100000 2.000000 4.000000
i 1.000000 7.970249 0.100000 1.000000 2.000000
i 1.000000 8.759728 0.100000 1.000000 3.000000
i 1.000000 9.549206 0.100000 1.000000 4.000000
i 1.000000 10.361905 0.100000 2.000000 3.000000
i 1.000000 11.128163 0.100000 2.000000 4.000000
i 1.000000 12.103401 0.100000 3.000000 4.000000

On Sun, Jul 26, 2020 at 6:12 PM Forrest Curo <treegestalt@gmail.com> wrote:
How could I make a file listing all score lines (including rt score events via command-line -L) in a csound run?

Forrest Curo
San Diego

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

Date2020-07-28 13:52
FromForrest Curo
SubjectRe: [Csnd] log of instrument calls
Um! Notes will proliferate if you simply add the logfile to the score and replay!

To prevent:

instr 1;     low notes of scale (degrees 1 & 2)
ip = p1
If(ip != int(ip)) igoto dontlog ; This score line is from the logfile
ip = ip + 0.5
itim times
S_event sprintf "i %f %f %f %f %f\n", ip, itim, p3, p4, p5
fprints "score.sco", S_event
dontlog:
[rest of instrument code]

On Mon, Jul 27, 2020 at 1:31 PM Forrest Curo <treegestalt@gmail.com> wrote:
Some scale & timbre changes were GUied into the first run, others were added real-time during playback...

On Mon, Jul 27, 2020 at 1:02 PM Forrest Curo <treegestalt@gmail.com> wrote:
And now (with a little copy & paste) I have playback! Can edit & (adding new instruments) accompany myself, whee!

ie
instr 1;     low notes of scale (degrees 1 & 2)
itim times
S_event sprintf "i %f %f %f %f %f\n", p1, itim, p3, p4, p5
fprints "score.sco", S_event
giscale[1] = p4;
giscale[2] = p5;
print giscale[1], giscale[2]
endin
=======
[score.sco]:

i 1.000000 0.000000 0.100000 2.000000 4.000000
i 1.000000 7.970249 0.100000 1.000000 2.000000
i 1.000000 8.759728 0.100000 1.000000 3.000000
i 1.000000 9.549206 0.100000 1.000000 4.000000
i 1.000000 10.361905 0.100000 2.000000 3.000000
i 1.000000 11.128163 0.100000 2.000000 4.000000
i 1.000000 12.103401 0.100000 3.000000 4.000000

On Sun, Jul 26, 2020 at 6:12 PM Forrest Curo <treegestalt@gmail.com> wrote:
How could I make a file listing all score lines (including rt score events via command-line -L) in a csound run?

Forrest Curo
San Diego

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

Date2020-07-29 04:39
FromForrest Curo
SubjectRe: [Csnd] log of instrument calls
I keep having trouble with fractional instrument calls. Csound keeps misreading them here as an opcode (integer part) plus one argument.

So. Extra instruments:
instr 1
and
instr 101. (etc)
Instrument 'n' writes its log data as a line calling instrument 'n+ 100', which is just like instrument 'n' except for not adding a score line.
Phew!

On Tue, Jul 28, 2020 at 5:52 AM Forrest Curo <treegestalt@gmail.com> wrote:
Um! Notes will proliferate if you simply add the logfile to the score and replay!

To prevent:

instr 1;     low notes of scale (degrees 1 & 2)
ip = p1
If(ip != int(ip)) igoto dontlog ; This score line is from the logfile
ip = ip + 0.5
itim times
S_event sprintf "i %f %f %f %f %f\n", ip, itim, p3, p4, p5
fprints "score.sco", S_event
dontlog:
[rest of instrument code]

On Mon, Jul 27, 2020 at 1:31 PM Forrest Curo <treegestalt@gmail.com> wrote:
Some scale & timbre changes were GUied into the first run, others were added real-time during playback...

On Mon, Jul 27, 2020 at 1:02 PM Forrest Curo <treegestalt@gmail.com> wrote:
And now (with a little copy & paste) I have playback! Can edit & (adding new instruments) accompany myself, whee!

ie
instr 1;     low notes of scale (degrees 1 & 2)
itim times
S_event sprintf "i %f %f %f %f %f\n", p1, itim, p3, p4, p5
fprints "score.sco", S_event
giscale[1] = p4;
giscale[2] = p5;
print giscale[1], giscale[2]
endin
=======
[score.sco]:

i 1.000000 0.000000 0.100000 2.000000 4.000000
i 1.000000 7.970249 0.100000 1.000000 2.000000
i 1.000000 8.759728 0.100000 1.000000 3.000000
i 1.000000 9.549206 0.100000 1.000000 4.000000
i 1.000000 10.361905 0.100000 2.000000 3.000000
i 1.000000 11.128163 0.100000 2.000000 4.000000
i 1.000000 12.103401 0.100000 3.000000 4.000000

On Sun, Jul 26, 2020 at 6:12 PM Forrest Curo <treegestalt@gmail.com> wrote:
How could I make a file listing all score lines (including rt score events via command-line -L) in a csound run?

Forrest Curo
San Diego

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

Date2020-08-14 20:57
FromForrest Curo
SubjectRe: [Csnd] log of instrument calls
Here, for anyone trying to do this, is how I got the start time and duration of a real-time instrument's notes into the score file: (You want an i-rate variable for the start time -- but duration [a k-rate variable] won't go accurately into a sprintf string without some maneuvering. Until I put in the line: "if (itom ==0) goto noprint" there'd be two score lines printed for each instance, one with a duration of 0.)

ktom timeinsts
if lastcycle() == 1 then
rerun:

itom = i(ktom)
        reinit rerun

S_event sprintf "i %d %.2f %.2f %d %d\n", 21, itim, itom, p4, p5
if (itom ==0) goto noprint
fprints "score.sco", S_event
noprint:
endif
endin

On Tue, Jul 28, 2020 at 8:39 PM Forrest Curo <treegestalt@gmail.com> wrote:
I keep having trouble with fractional instrument calls. Csound keeps misreading them here as an opcode (integer part) plus one argument.

So. Extra instruments:
instr 1
and
instr 101. (etc)
Instrument 'n' writes its log data as a line calling instrument 'n+ 100', which is just like instrument 'n' except for not adding a score line.
Phew!

On Tue, Jul 28, 2020 at 5:52 AM Forrest Curo <treegestalt@gmail.com> wrote:
Um! Notes will proliferate if you simply add the logfile to the score and replay!

To prevent:

instr 1;     low notes of scale (degrees 1 & 2)
ip = p1
If(ip != int(ip)) igoto dontlog ; This score line is from the logfile
ip = ip + 0.5
itim times
S_event sprintf "i %f %f %f %f %f\n", ip, itim, p3, p4, p5
fprints "score.sco", S_event
dontlog:
[rest of instrument code]

On Mon, Jul 27, 2020 at 1:31 PM Forrest Curo <treegestalt@gmail.com> wrote:
Some scale & timbre changes were GUied into the first run, others were added real-time during playback...

On Mon, Jul 27, 2020 at 1:02 PM Forrest Curo <treegestalt@gmail.com> wrote:
And now (with a little copy & paste) I have playback! Can edit & (adding new instruments) accompany myself, whee!

ie
instr 1;     low notes of scale (degrees 1 & 2)
itim times
S_event sprintf "i %f %f %f %f %f\n", p1, itim, p3, p4, p5
fprints "score.sco", S_event
giscale[1] = p4;
giscale[2] = p5;
print giscale[1], giscale[2]
endin
=======
[score.sco]:

i 1.000000 0.000000 0.100000 2.000000 4.000000
i 1.000000 7.970249 0.100000 1.000000 2.000000
i 1.000000 8.759728 0.100000 1.000000 3.000000
i 1.000000 9.549206 0.100000 1.000000 4.000000
i 1.000000 10.361905 0.100000 2.000000 3.000000
i 1.000000 11.128163 0.100000 2.000000 4.000000
i 1.000000 12.103401 0.100000 3.000000 4.000000

On Sun, Jul 26, 2020 at 6:12 PM Forrest Curo <treegestalt@gmail.com> wrote:
How could I make a file listing all score lines (including rt score events via command-line -L) in a csound run?

Forrest Curo
San Diego

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