Csound Csound-dev Csound-tekno Search About

[Csnd] record all events in a text

Date2020-03-31 17:26
Fromjacqouemin
Subject[Csnd] record all events in a text
Hello,

I was wondering if there is a way to tell csound to record all the events he
receives and "score" that it creates for exemple in a live coding
performance!
Can anybody suggest me a way?

Thank you!
Best,

j



--
Sent from: http://csound.1045644.n5.nabble.com/Csound-General-f1093014.html

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-03-31 18:33
Fromjoachim heintz
SubjectRe: [Csnd] record all events in a text
hi -

to write the events in a text file should be easy.  you could, for 
instance, write the absolute time in the moment an instrument is called, 
together with the p-fileds in a text via fprints.

the challenge might be more how you organize your data if you want, for 
instance, reproduce your life performance.

if you like, post here, and tell what is not working as you wish.  but 
perhaps others have different suggestions.

best -
	joachim


On 31/03/2020 18:26, jacqouemin wrote:
> Hello,
> 
> I was wondering if there is a way to tell csound to record all the events he
> receives and "score" that it creates for exemple in a live coding
> performance!
> Can anybody suggest me a way?
> 
> Thank you!
> Best,
> 
> j
> 
> 
> 
> --
> Sent from: http://csound.1045644.n5.nabble.com/Csound-General-f1093014.html
> 
> 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-03-31 22:09
Fromjacqouemin
SubjectRe: [Csnd] record all events in a text
Thank you joachim for your answer,

I did as you said and it works really well, but if I want to pass a String
to fprintks (like the names of the instruments instead of the numbers), it
doesn't work. 

I found in the mailing list that you've got the same problem:

http://csound.1045644.n5.nabble.com/writing-a-format-string-with-fprints-td1118932.html

So I followed the answer and I put a sprintfk to bypass the problem and it
doesn't work at all. It is like that all the values stay at 0..

What I mean: if i use nstrnum to get the number of the instrument with
fprintks everything works well:

   fprintks "i %i %f %f %f", nstrnum("myInstr"), p1, p2, p3

but if I do like this:

   fprintks "i %i %f %f %f", sprintfk("i %i %f %f %f", "myInstr", p1, p2,
p3)

It does not work.

Is there a reason?



--
Sent from: http://csound.1045644.n5.nabble.com/Csound-General-f1093014.html

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-03-31 22:13
Fromjacqouemin
SubjectRe: [Csnd] record all events in a text
errata corrige:

If i use nstrnum to get the number of the instrument with fprintks
everything works well:

  fprintks Snamefile, "i %i %f %f %f", nstrnum("myInstr"), p1, p2, p3

but if I do like this:

  fprintks Snamefile, sprintfk("i %s %f %f %f", "myInstr", p1, p2, p3)

It does not work.



--
Sent from: http://csound.1045644.n5.nabble.com/Csound-General-f1093014.html

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-04-01 09:17
Fromjoachim heintz
SubjectRe: [Csnd] record all events in a text
yes -- as far as i see the %s formatter is not included in fprint(k)s.

for your case i think it is not a big deal: you can work with the 
instrument numbers.

but perhaps you can open a ticket at 
https://github.com/csound/csound/issues and request this as improvement? 
  i assume it will not be difficult to add, because it is already in 
print(k)s.

best -
	joachim



On 31/03/2020 23:13, jacqouemin wrote:
> errata corrige:
> 
> If i use nstrnum to get the number of the instrument with fprintks
> everything works well:
> 
>    fprintks Snamefile, "i %i %f %f %f", nstrnum("myInstr"), p1, p2, p3
> 
> but if I do like this:
> 
>    fprintks Snamefile, sprintfk("i %s %f %f %f", "myInstr", p1, p2, p3)
> 
> It does not work.
> 
> 
> 
> --
> Sent from: http://csound.1045644.n5.nabble.com/Csound-General-f1093014.html
> 
> 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-04-01 13:44
Fromjoachim heintz
SubjectRe: [Csnd] record all events in a text
by the way, another idea would be to use the system(_i) opcode:

  S_write sprintf "echo %s %d %f %f >> test.txt", "myinstr", p1, p2, p3
  iDone system_i 1, S_write

it may depend on your operating system; for me on linux it works very well.



On 01/04/2020 10:17, joachim heintz wrote:
> yes -- as far as i see the %s formatter is not included in fprint(k)s.
> 
> for your case i think it is not a big deal: you can work with the 
> instrument numbers.
> 
> but perhaps you can open a ticket at 
> https://github.com/csound/csound/issues and request this as improvement? 
>   i assume it will not be difficult to add, because it is already in 
> print(k)s.
> 
> best -
>      joachim
> 
> 
> 
> On 31/03/2020 23:13, jacqouemin wrote:
>> errata corrige:
>>
>> If i use nstrnum to get the number of the instrument with fprintks
>> everything works well:
>>
>>    fprintks Snamefile, "i %i %f %f %f", nstrnum("myInstr"), p1, p2, p3
>>
>> but if I do like this:
>>
>>    fprintks Snamefile, sprintfk("i %s %f %f %f", "myInstr", p1, p2, p3)
>>
>> It does not work.
>>
>>
>>
>> -- 
>> Sent from: 
>> http://csound.1045644.n5.nabble.com/Csound-General-f1093014.html
>>
>> 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-04-01 14:10
FromRory Walsh
SubjectRe: [Csnd] record all events in a text
FWIW, I have a plugin opcode that will write a string straight to file:
Binaries are available on the main page.  

On Wed, 1 Apr 2020 at 13:44, joachim heintz <jh@joachimheintz.de> wrote:
by the way, another idea would be to use the system(_i) opcode:

  S_write sprintf "echo %s %d %f %f >> test.txt", "myinstr", p1, p2, p3
  iDone system_i 1, S_write

it may depend on your operating system; for me on linux it works very well.



On 01/04/2020 10:17, joachim heintz wrote:
> yes -- as far as i see the %s formatter is not included in fprint(k)s.
>
> for your case i think it is not a big deal: you can work with the
> instrument numbers.
>
> but perhaps you can open a ticket at
> https://github.com/csound/csound/issues and request this as improvement?
>   i assume it will not be difficult to add, because it is already in
> print(k)s.
>
> best -
>      joachim
>
>
>
> On 31/03/2020 23:13, jacqouemin wrote:
>> errata corrige:
>>
>> If i use nstrnum to get the number of the instrument with fprintks
>> everything works well:
>>
>>    fprintks Snamefile, "i %i %f %f %f", nstrnum("myInstr"), p1, p2, p3
>>
>> but if I do like this:
>>
>>    fprintks Snamefile, sprintfk("i %s %f %f %f", "myInstr", p1, p2, p3)
>>
>> It does not work.
>>
>>
>>
>> --
>> Sent from:
>> http://csound.1045644.n5.nabble.com/Csound-General-f1093014.html
>>
>> 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

Date2020-04-01 18:23
Fromjohn
SubjectRe: [Csnd] record all events in a text
I added %s to fprint(k)s.  In github now -- onlt simple testing so far


On Wed, 1 Apr 2020, joachim heintz wrote:

> yes -- as far as i see the %s formatter is not included in fprint(k)s.
>
> for your case i think it is not a big deal: you can work with the instrument 
> numbers.
>
> but perhaps you can open a ticket at https://github.com/csound/csound/issues 
> and request this as improvement?  i assume it will not be difficult to add, 
> because it is already in print(k)s.
>
> best -
> 	joachim
>
>
>
> On 31/03/2020 23:13, jacqouemin wrote:
>> errata corrige:
>> 
>> If i use nstrnum to get the number of the instrument with fprintks
>> everything works well:
>>
>>    fprintks Snamefile, "i %i %f %f %f", nstrnum("myInstr"), p1, p2, p3
>> 
>> but if I do like this:
>>
>>    fprintks Snamefile, sprintfk("i %s %f %f %f", "myInstr", p1, p2, p3)
>> 
>> It does not work.
>> 
>> 
>> 
>> --
>> Sent from: http://csound.1045644.n5.nabble.com/Csound-General-f1093014.html
>> 
>> 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-04-01 19:14
Fromjoachim heintz
SubjectRe: [Csnd] record all events in a text
oh super.  i tried, but for

fprints "test.txt", "%d %d %f %f\n", "instr eins", p1, p2, p3

i get this error:
error:  Unable to find opcode entry for 'fprints' with matching argument 
types:
Found: (null) fprints SSSppp



On 01/04/2020 19:23, john wrote:
> I added %s to fprint(k)s.  In github now -- onlt simple testing so far
> 
> 
> On Wed, 1 Apr 2020, joachim heintz wrote:
> 
>> yes -- as far as i see the %s formatter is not included in fprint(k)s.
>>
>> for your case i think it is not a big deal: you can work with the 
>> instrument numbers.
>>
>> but perhaps you can open a ticket at 
>> https://github.com/csound/csound/issues and request this as 
>> improvement?  i assume it will not be difficult to add, because it is 
>> already in print(k)s.
>>
>> best -
>>     joachim
>>
>>
>>
>> On 31/03/2020 23:13, jacqouemin wrote:
>>> errata corrige:
>>>
>>> If i use nstrnum to get the number of the instrument with fprintks
>>> everything works well:
>>>
>>>    fprintks Snamefile, "i %i %f %f %f", nstrnum("myInstr"), p1, p2, p3
>>>
>>> but if I do like this:
>>>
>>>    fprintks Snamefile, sprintfk("i %s %f %f %f", "myInstr", p1, p2, p3)
>>>
>>> It does not work.
>>>
>>>
>>>
>>> -- 
>>> Sent from: 
>>> http://csound.1045644.n5.nabble.com/Csound-General-f1093014.html
>>>
>>> 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

Date2020-04-01 20:06
Fromjohn
SubjectRe: [Csnd] record all events in a text
My test is




instr foo
fprintks "/tmp/ff", sprintfk("i %s %f %f %f", "myInstr", p1, p2, p3)
turnoff
   endin



i "foo" 0 1
e




with output as I expected



On Wed, 1 Apr 2020, joachim heintz wrote:

> oh super.  i tried, but for
>
> fprints "test.txt", "%d %d %f %f\n", "instr eins", p1, p2, p3
>
> i get this error:
> error:  Unable to find opcode entry for 'fprints' with matching argument 
> types:
> Found: (null) fprints SSSppp
>
>
>
> On 01/04/2020 19:23, john wrote:
>> I added %s to fprint(k)s.  In github now -- onlt simple testing so far
>> 
>> 
>> On Wed, 1 Apr 2020, joachim heintz wrote:
>> 
>>> yes -- as far as i see the %s formatter is not included in fprint(k)s.
>>> 
>>> for your case i think it is not a big deal: you can work with the 
>>> instrument numbers.
>>> 
>>> but perhaps you can open a ticket at 
>>> https://github.com/csound/csound/issues and request this as improvement?  
>>> i assume it will not be difficult to add, because it is already in 
>>> print(k)s.
>>> 
>>> best -
>>>     joachim
>>> 
>>> 
>>> 
>>> On 31/03/2020 23:13, jacqouemin wrote:
>>>> errata corrige:
>>>> 
>>>> If i use nstrnum to get the number of the instrument with fprintks
>>>> everything works well:
>>>> 
>>>>    fprintks Snamefile, "i %i %f %f %f", nstrnum("myInstr"), p1, p2, p3
>>>> 
>>>> but if I do like this:
>>>> 
>>>>    fprintks Snamefile, sprintfk("i %s %f %f %f", "myInstr", p1, p2, p3)
>>>> 
>>>> It does not work.
>>>> 
>>>> 
>>>> 
>>>> -- 
>>>> Sent from: 
>>>> http://csound.1045644.n5.nabble.com/Csound-General-f1093014.html
>>>> 
>>>> 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

Date2020-04-01 20:09
Fromjohn
SubjectRe: [Csnd] record all events in a text
Arhh  not the rght test  .Please send me a test of the right thing

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-04-01 21:07
Fromjoachim heintz
SubjectRe: [Csnd] record all events in a text
hmm, i don't understand.  your test uses the %s formatter in sprintfk, 
not in fprintks.
is this what you meant?  you wrote:
"I added %s to fprint(k)s."



On 01/04/2020 21:06, john wrote:
> My test is
> 
> 
> 
> 
> instr foo
> fprintks "/tmp/ff", sprintfk("i %s %f %f %f", "myInstr", p1, p2, p3)
> turnoff
>    endin
> 
> 
> 
> i "foo" 0 1
> e
> 
> 
> 
> 
> with output as I expected
> 
> 
> 
> On Wed, 1 Apr 2020, joachim heintz wrote:
> 
>> oh super.  i tried, but for
>>
>> fprints "test.txt", "%d %d %f %f\n", "instr eins", p1, p2, p3
>>
>> i get this error:
>> error:  Unable to find opcode entry for 'fprints' with matching 
>> argument types:
>> Found: (null) fprints SSSppp
>>
>>
>>
>> On 01/04/2020 19:23, john wrote:
>>> I added %s to fprint(k)s.  In github now -- onlt simple testing so far
>>>
>>>
>>> On Wed, 1 Apr 2020, joachim heintz wrote:
>>>
>>>> yes -- as far as i see the %s formatter is not included in fprint(k)s.
>>>>
>>>> for your case i think it is not a big deal: you can work with the 
>>>> instrument numbers.
>>>>
>>>> but perhaps you can open a ticket at 
>>>> https://github.com/csound/csound/issues and request this as 
>>>> improvement? i assume it will not be difficult to add, because it is 
>>>> already in print(k)s.
>>>>
>>>> best -
>>>>     joachim
>>>>
>>>>
>>>>
>>>> On 31/03/2020 23:13, jacqouemin wrote:
>>>>> errata corrige:
>>>>>
>>>>> If i use nstrnum to get the number of the instrument with fprintks
>>>>> everything works well:
>>>>>
>>>>>    fprintks Snamefile, "i %i %f %f %f", nstrnum("myInstr"), p1, p2, p3
>>>>>
>>>>> but if I do like this:
>>>>>
>>>>>    fprintks Snamefile, sprintfk("i %s %f %f %f", "myInstr", p1, p2, 
>>>>> p3)
>>>>>
>>>>> It does not work.
>>>>>
>>>>>
>>>>>
>>>>> -- 
>>>>> Sent from: 
>>>>> http://csound.1045644.n5.nabble.com/Csound-General-f1093014.html
>>>>>
>>>>> 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

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