Csound Csound-dev Csound-tekno Search About

[Csnd] Question re: writing one instr to a table to be read by another

Date2023-02-01 14:22
FromScott Daughtrey
Subject[Csnd] Question re: writing one instr to a table to be read by another
Is it possible to write  audio to a table while another reads it, 
in real-time? I'd like to be able to record say 5 -10 seconds of audio continuously, which will just be constantly replaced/overwritten by incoming audio. I did see as example in the FLOSS manual using tablew and I believe GEN02, but it wasn't written to operated in real-time.

Is it possible and if so is there a recommended way to go about it?

Thanks for any advice or guidance, 
Scott

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

Date2023-02-01 20:07
Fromjoachim heintz
SubjectRe: [Csnd] Question re: writing one instr to a table to be read by another
sure there is no problem.
if you like, try and get back here if you need help.
the floss example should be adjustable to work in real-time.

	joachim


On 01/02/2023 15:22, Scott Daughtrey wrote:
> Is it possible to write  audio to a table while another reads it,
> in real-time? I'd like to be able to record say 5 -10 seconds of audio continuously, which will just be constantly replaced/overwritten by incoming audio. I did see as example in the FLOSS manual using tablew and I believe GEN02, but it wasn't written to operated in real-time.
> 
> Is it possible and if so is there a recommended way to go about it?
> 
> Thanks for any advice or guidance,
> Scott
> 
> 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

Date2023-02-02 08:55
FromVictor Lazzarini
SubjectRe: [Csnd] [EXTERNAL] [Csnd] Question re: writing one instr to a table to be read by another
yes, you can without any problems. Unless you are running in parallel (-j N), which is not the usual way to do things, 
all instruments run sequentially, in instrument order. Since tables are global objects, you can access them for reading
or writing from any instrument.

For example, you can write to it in instr X and then read from instr X+N, that will ensure no extra delays are added
to the process.

An alternative to function tables are global arrays (k or a, depending on what you need to do). 

best regards
========================
Prof. Victor Lazzarini
Maynooth University
Ireland

> On 1 Feb 2023, at 14:22, Scott Daughtrey  wrote:
> 
> *Warning*
> 
> This email originated from outside of Maynooth University's Mail System. Do not reply, click links or open attachments unless you recognise the sender and know the content is safe.
> 
> Is it possible to write  audio to a table while another reads it,
> in real-time? I'd like to be able to record say 5 -10 seconds of audio continuously, which will just be constantly replaced/overwritten by incoming audio. I did see as example in the FLOSS manual using tablew and I believe GEN02, but it wasn't written to operated in real-time.
> 
> Is it possible and if so is there a recommended way to go about it?
> 
> Thanks for any advice or guidance,
> Scott
> 
> Csound mailing list
> Csound@listserv.heanet.ie
> https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Flistserv.heanet.ie%2Fcgi-bin%2Fwa%3FA0%3DCSOUND&data=05%7C01%7CVictor.Lazzarini%40mu.ie%7Cd73e1aceb1f14833dedb08db045f343c%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638108579161005439%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=bO2BI3rxupdnaEKefJE9lxlwVy%2FAoLlwSadsB9v3POM%3D&reserved=0
> Send bugs reports to
>        https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fcsound%2Fcsound%2Fissues&data=05%7C01%7CVictor.Lazzarini%40mu.ie%7Cd73e1aceb1f14833dedb08db045f343c%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638108579161005439%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=adt%2FSj0vNxiCPRhOHKq6rfq4WYK%2Bevw9vMGWYZbFbHw%3D&reserved=0
> 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