Csound Csound-dev Csound-tekno Search About

[Csnd] Resampling

Date2018-04-04 10:02
FromEdward Costello
Subject[Csnd] Resampling
Hi, 

What is the best way to resample audio with Csound? Is there an available opcode, also is it possible to set sample rate on a per instrument basis.
Thanks
Ed
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

Date2018-04-04 12:35
FromSteven Yi
SubjectRe: [Csnd] Resampling
Not my area of expertise, but diskin2 has sinc interpolation as an
option to resample to sr. Is that the kind of thing you're looking
for, resampling from a sound file, or are you looking to take a table
of data and resample in memory to another table?  (Or something else?)

There is no sample-rate per instrument.  It's come up for discussion
before but we never made any decisions on how to implement.  Perhaps
drawing up a set of requirements and collaborating on a proposed
syntax/set of opcodes/etc. would get the ball rolling. (Probably
should be done in CS7.)

On Wed, Apr 4, 2018 at 5:02 AM, Edward Costello  wrote:
> Hi,
>
> What is the best way to resample audio with Csound? Is there an available opcode, also is it possible to set sample rate on a per instrument basis.
> Thanks
> Ed
> 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

Date2018-04-04 13:08
FromJohn ff
SubjectRe: [Csnd] Resampling
I always use src_conv on audio files that need resampling.  For on-the-fly resampling I think diskin2 is all we have got.  It might be nice to have an opcode but the obvious way has licencing problems

⁣Sent from TypeApp ​

On Apr 4, 2018, 10:03, at 10:03, Edward Costello  wrote:
>Hi, 
>
>What is the best way to resample audio with Csound? Is there an
>available opcode, also is it possible to set sample rate on a per
>instrument basis.
>Thanks
>Ed
>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

Date2018-04-04 14:57
FromEdward Costello
SubjectRe: [Csnd] Resampling
@Steven, I’ve implemented an opcode for tracking formants in audio files on a per sample basis, unfortunately it’s very processor intensive so I would like to run it at a lower sample rate (11025) so I can do so in realtime. However, I would also like to take the formant outputs from that opcode and send them to an instrument running at a better sample rate (44100) and have that instrument synthesise the audio. 
@Steven & John ff, it seems that libsamplerate can resample audio in a streaming fashion. This could be used to convert sample rates on the fly when running instruments at different rates, it’s 2-clause BSD license, does that interfere with the LGPL? Also I suppose it would add another dependency. 
Thanks
Ed

> On 4 Apr 2018, at 13:08, John ff  wrote:
> 
> I always use src_conv on audio files that need resampling.  For on-the-fly resampling I think diskin2 is all we have got.  It might be nice to have an opcode but the obvious way has licencing problems
> 
> ⁣Sent from TypeApp ​
> 
> On Apr 4, 2018, 10:03, at 10:03, Edward Costello  wrote:
>> Hi,
>> 
>> What is the best way to resample audio with Csound? Is there an
>> available opcode, also is it possible to set sample rate on a per
>> instrument basis.
>> Thanks
>> Ed
>> 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

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

Date2018-04-04 15:18
Fromjpff
SubjectRe: [Csnd] Resampling
All the sources of libsamplerate I have are GPL2 or later

On Wed, 4 Apr 2018, Edward Costello wrote:

> @Steven, I’ve implemented an opcode for tracking formants in audio files on a per sample basis, unfortunately it’s very processor intensive so I would like to run it at a lower sample rate (11025) so I can do so in realtime. However, I would also like to take the formant outputs from that opcode and send them to an instrument running at a better sample rate (44100) and have that instrument synthesise the audio.
> @Steven & John ff, it seems that libsamplerate can resample audio in a streaming fashion. This could be used to convert sample rates on the fly when running instruments at different rates, it’s 2-clause BSD license, does that interfere with the LGPL? Also I suppose it would add another dependency.
> Thanks
> Ed
>
>> On 4 Apr 2018, at 13:08, John ff  wrote:
>>
>> I always use src_conv on audio files that need resampling.  For on-the-fly resampling I think diskin2 is all we have got.  It might be nice to have an opcode but the obvious way has licencing problems
>>
>> ⁣Sent from TypeApp ​
>>
>> On Apr 4, 2018, 10:03, at 10:03, Edward Costello  wrote:
>>> Hi,
>>>
>>> What is the best way to resample audio with Csound? Is there an
>>> available opcode, also is it possible to set sample rate on a per
>>> instrument basis.
>>> Thanks
>>> Ed
>>> 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
>
> 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

Date2018-04-04 15:31
Fromjpff
SubjectRe: [Csnd] Resampling
I see that there is a later version than 0.1.8 that coes with openSuSE. 
How common is 0.1.9?  That could make src_conv easier too

More to do....

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