Csound Csound-dev Csound-tekno Search About

[Csnd-dev] Dynamic Memory Allocation During Performance

Date2016-09-23 21:11
FromEd Costello
Subject[Csnd-dev] Dynamic Memory Allocation During Performance
Hi,

I want to alter the Websocket opcode so it can receive strings of any size during performance. Currently it can only receive strings into a string argument that has already been defined, so the strings are going to be limited to whatever size the original argument was.
I want to be able to receive any size at all, for the purpose dynamically creating instruments sent over the websocket. Should I be able to do this by dynamically allocating and reallocating the opcodes string output argument memory? Are there any pitfalls to this? Of course I know one should try and avoid allocating memory while audio is being processed.
Thanks
Ed
--
Edward Costello

Date2016-09-23 21:22
FromVictor Lazzarini
SubjectRe: [Csnd-dev] Dynamic Memory Allocation During Performance
At i-time it should be grand, but at perf time, maybe better to do it in a separate thread and signal when complete.

Victor Lazzarini
Dean of Arts, Celtic Studies, and Philosophy
Maynooth University
Ireland

> On 23 Sep 2016, at 21:11, Ed Costello  wrote:
> 
> Hi,
> 
> I want to alter the Websocket opcode so it can receive strings of any size during performance. Currently it can only receive strings into a string argument that has already been defined, so the strings are going to be limited to whatever size the original argument was.
> I want to be able to receive any size at all, for the purpose dynamically creating instruments sent over the websocket. Should I be able to do this by dynamically allocating and reallocating the opcodes string output argument memory? Are there any pitfalls to this? Of course I know one should try and avoid allocating memory while audio is being processed.
> Thanks
> Ed
> --