[Csnd] write function table to audio file

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[Csnd] write function table to audio file

zappfinger
Is there an opcode for writing (part of) a function table to an audio
file? Sort of inverse GEN1?
What I am trying to do is record some sound when a threshold is crossed
and then stop recording when below a second threshold.
This should then be written to an audio file. I could not find an opcode
to write a table to an audio file...

Richard

Csound mailing list
[hidden email]
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
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Csnd] write function table to audio file

Jeanette C.
Jul 30 2017, Richard has written:

> Is there an opcode for writing (part of) a function table to an audio file?
Hi Richard,
no, I don't think so. but there are different ways, that I can think of.

Writing RAW samples (optionally to be converted to a file with some
header externally) you can use ftsave/ftsavek. These files can easily be
loaded into Csound again without any further, external modification.

You might use fout with a special writing instrument, you only have to
calculate the "pitch" or rate of the part of you ftable, so it can be
played back at original tempo and frequency. You can use the table
opcode family (table, table3,...) and - perhaps - a modified phasor to
read your audio material and then write the resultant audio signal to a
file. AFAIK, fout can write multi-channel signals as well.

HTH.
...

Best wishes,

Jeanette

--------
* website: http://juliencoder.de - for summer is a state of sound
* SoundCloud: https://soundcloud.com/jeanette_c

But now I'm stronger than yesterday <3
(Britney Spears)

Csound mailing list
[hidden email]
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
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Csnd] write function table to audio file

Victor Lazzarini-2
It should be easy enough to do an UDO.

opcode TabWrite,0,Siii
setksmps 1
Sn,ifn,ist,iend xin
kcnt init ist
while kcnt < iend do
asmp table a(kcnt), ifn
fout Sn, 2, asmp
kcnt+=1
od
endop

Not tested but that's the gist of it.



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

> On 29 Jul 2017, at 23:34, Jeanette C. <[hidden email]> wrote:
>
> Jul 30 2017, Richard has written:
>
>> Is there an opcode for writing (part of) a function table to an audio file?
> Hi Richard,
> no, I don't think so. but there are different ways, that I can think of.
>
> Writing RAW samples (optionally to be converted to a file with some
> header externally) you can use ftsave/ftsavek. These files can easily be
> loaded into Csound again without any further, external modification.
>
> You might use fout with a special writing instrument, you only have to
> calculate the "pitch" or rate of the part of you ftable, so it can be
> played back at original tempo and frequency. You can use the table
> opcode family (table, table3,...) and - perhaps - a modified phasor to
> read your audio material and then write the resultant audio signal to a
> file. AFAIK, fout can write multi-channel signals as well.
>
> HTH.
> ...
>
> Best wishes,
>
> Jeanette
>
> --------
> * website: http://juliencoder.de - for summer is a state of sound
> * SoundCloud: https://soundcloud.com/jeanette_c
>
> But now I'm stronger than yesterday <3
> (Britney Spears)
>
> Csound mailing list
> [hidden email]
> 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
[hidden email]
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
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Csnd] write function table to audio file

zappfinger
Thanks, I'll give that a try..

Richard


On 30/07/17 09:51, Victor Lazzarini wrote:

> It should be easy enough to do an UDO.
>
> opcode TabWrite,0,Siii
> setksmps 1
> Sn,ifn,ist,iend xin
> kcnt init ist
> while kcnt < iend do
> asmp table a(kcnt), ifn
> fout Sn, 2, asmp
> kcnt+=1
> od
> endop
>
> Not tested but that's the gist of it.
>
>
>
> Victor Lazzarini
> Dean of Arts, Celtic Studies, and Philosophy
> Maynooth University
> Ireland
>
>> On 29 Jul 2017, at 23:34, Jeanette C. <[hidden email]> wrote:
>>
>> Jul 30 2017, Richard has written:
>>
>>> Is there an opcode for writing (part of) a function table to an audio file?
>> Hi Richard,
>> no, I don't think so. but there are different ways, that I can think of.
>>
>> Writing RAW samples (optionally to be converted to a file with some
>> header externally) you can use ftsave/ftsavek. These files can easily be
>> loaded into Csound again without any further, external modification.
>>
>> You might use fout with a special writing instrument, you only have to
>> calculate the "pitch" or rate of the part of you ftable, so it can be
>> played back at original tempo and frequency. You can use the table
>> opcode family (table, table3,...) and - perhaps - a modified phasor to
>> read your audio material and then write the resultant audio signal to a
>> file. AFAIK, fout can write multi-channel signals as well.
>>
>> HTH.
>> ...
>>
>> Best wishes,
>>
>> Jeanette
>>
>> --------
>> * website: http://juliencoder.de - for summer is a state of sound
>> * SoundCloud: https://soundcloud.com/jeanette_c
>>
>> But now I'm stronger than yesterday <3
>> (Britney Spears)
>>
>> Csound mailing list
>> [hidden email]
>> 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
> [hidden email]
> 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
[hidden email]
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
Loading...