There are some new User Defined Opcodes which are designed to simplify live recording and playback with Csound:
1. BufRec records in a buffer (function table), with optional start point, end point, and wrap (loop record).
http://www.csounds.com/udo/displayOpcode.php?opcode_id=135
http://www.csounds.com/udo/displayOpcode.php?opcode_id=146
2. BufPlay plays from a buffer (function table), with control over speed (forward - backward), volume, start point, end point, and different options of wrapping/looping.
http://www.csounds.com/udo/displayOpcode.php?opcode_id=136
http://www.csounds.com/udo/displayOpcode.php?opcode_id=143
3. BufCt creates a function table of ilen seconds for recording by just giving the ilen argument.
http://www.csounds.com/udo/displayOpcode.php?opcode_id=137
http://www.csounds.com/udo/displayOpcode.php?opcode_id=144
4. BufFiPl plays a soundfile from a GEN01 function table, including sample rate conversion.
http://www.csounds.com/udo/displayOpcode.php?opcode_id=83
http://www.csounds.com/udo/displayOpcode.php?opcode_id=84
http://www.csounds.com/udo/displayOpcode.php?opcode_id=87
http://www.csounds.com/udo/displayOpcode.php?opcode_id=88
If you want to use the computer keyboard for triggering, these UDOs may be useful:
KeyOnce returns '1' once in the k-cycle a certain key has been pressed or released. It is similar to the Max or PD objects Key / Keyup: http://www.csounds.com/udo/displayOpcode.php?opcode_id=133
KeyStay returns '1' as long as a certain key is hold: http://www.csounds.com/udo/displayOpcode.php?opcode_id=134
Examples are on the linked pages.


