Csound Csound-dev Csound-tekno Search About

[Csnd] recordstart & playstart

Date2022-04-11 20:45
Fromjacopo greco d'alceo
Subject[Csnd] recordstart & playstart
Hi all,
i think i've heard that we can save every message, every MIDI event and everything we sent in csound through a message like "recordstart" and then save them in .bin file in order to replay it wherever we want with "playstart". I think we can do this with the csound~ object in max. 

Does it exist a way to do that in csound pure ?

thank you,
best,
jacopo

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

Date2022-04-12 09:22
Fromjoachim heintz
SubjectRe: [Csnd] recordstart & playstart
hi jacopo -

as you can write and read files, i am sure you can make it work in any 
csound.  if you tell a bit more in detail what you want to do, and in 
which environment, we can help here is you need help.

cheers -
	joachim


On 11/04/2022 21:45, jacopo greco d'alceo wrote:
> Hi all,
> i think i've heard that we can save every message, every MIDI event and everything we sent in csound through a message like "recordstart" and then save them in .bin file in order to replay it wherever we want with "playstart". I think we can do this with the csound~ object in max.
> 
> Does it exist a way to do that in csound pure ?
> 
> thank you,
> best,
> jacopo
> 
> 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

Date2022-04-12 09:30
Fromjacopo mascheroni
SubjectRe: [Csnd] recordstart & playstart
Hi Joachim,

What I’d like to do is to record an entire session of csound for exemple with livecoding and midi (so to record every message I send) and then play it back in csound with a score or something similar.

I heard about this function in the csound~ object that allows you to record into a .bin file every message you send (and I tested, it works) to an active session and I was wondering if there’s something similar with csound because I cannot find anything on the web about this rare function !
Hope it’s clear,
Thank you,

   

> On 12 Apr 2022, at 10:22, joachim heintz  wrote:
> 
> hi jacopo -
> 
> as you can write and read files, i am sure you can make it work in any csound.  if you tell a bit more in detail what you want to do, and in which environment, we can help here is you need help.
> 
> cheers -
> 	joachim
> 
> 
> On 11/04/2022 21:45, jacopo greco d'alceo wrote:
>> Hi all,
>> i think i've heard that we can save every message, every MIDI event and everything we sent in csound through a message like "recordstart" and then save them in .bin file in order to replay it wherever we want with "playstart". I think we can do this with the csound~ object in max.
>> Does it exist a way to do that in csound pure ?
>> thank you,
>> best,
>> jacopo
>> 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

Date2022-04-12 17:49
Fromjoachim heintz
SubjectRe: [Csnd] recordstart & playstart
hi again -

you will have to write code depending on your needs.  below is a simple 
example.  once you started, you have ten seconds for a live performance 
with the computer keyboard. this will be written as single score lines 
to a text file called "events.txt".  after one second pause, this will 
be repeated, as this file is being read, and all events are scheduled again.

there are certainly other possibilities; i don't know how the function 
in the csound~ object is programmed.

cheers -
	joachim




-odac



sr = 44100
ksmps = 64
nchnls = 2
0dbfs = 1

instr Record
  key, kdown sensekey
  if kdown==1 && changed(kdown)==1 then
   fprintks("events.txt","i \"Sound\" %f 1 %d\n",timeinsts(),key)
   schedulek("Sound",0,1,key)
  endif
endin

instr Repeat
  ilinenum init 0
  while ilinenum != -1 do
   Sline,ilinenum readfi "events.txt"
   scoreline_i(Sline)
  od
endin

instr Sound
  iPch = p4
  aSound = mode(mpulse(1,p3),mtof(iPch),random:i(50,200))
  outall(aSound)
endin



i "Record" 0 10
i "Repeat" 11 10



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