[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
        Issues · csound/csound · GitHub
Discussions of bugs and features can be posted here

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

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,

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

<CsoundSynthesizer>
<CsOptions>
-odac
</CsOptions>
<CsInstruments>

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

</CsInstruments>
<CsScore>
i "Record" 0 10
i "Repeat" 11 10
</CsScore>
</CsoundSynthesizer>

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        Issues · csound/csound · GitHub
Discussions of bugs and features can be posted here