recInstr

Contents

recInstr#

csoundengine.csoundlib.recInstr(body, events, init='', outfile='', sr=44100, ksmps=64, nchnls=2, a4=442, samplefmt='float', dur=None)[source]#

Record one instrument for a given duration

Parameters:
  • dur – the duration of the recording

  • body (str) – the body of the instrument

  • init – the initialization code (ftgens, global vars, etc)

  • outfile – the generated output, or None to generate a temporary file

  • events (list) – a list of events, where each event is a list of pargs passed to the instrument, beginning with p2: delay, dur, [p4, p5, …]

  • sr – the samplerate

  • a4 – A4 frequency

  • ksmps – block size

  • nchnls – number of output channels

  • samplefmt – defines the sample format used for outfile, one of (16, 24, 32, ‘float’)

Return type:

tuple[str, Popen]

Returns:

a tuple (outfile to be generated, _subprocess.Popen running csound)