Csound Csound-dev Csound-tekno Search About

[Csnd-dev] having a shot at fixing tbvcf

Date2016-01-17 11:27
FromPeter Burgess
Subject[Csnd-dev] having a shot at fixing tbvcf
Attachmentstbvcf2.c  tbvcf2.h  
Hi there, I thought I'd have a shot at fixing the sample rate issues
with tbvcf. I've compiled my own version with a minor alteration. I'm
getting a warning during compilation though, that is reflected by an
error when I try to use the library in csound.

The two lines of code causing the warning are:

    p->fcocod = IS_ASIG_ARG(p->fco) ? 1 : 0;
    p->rezcod = IS_ASIG_ARG(p->res) ? 1 : 0;

The compilation warning:

warning: implicit declaration of function ‘csoundGetTypeForArg’

The csound error:

WARNING: could not open llibrary
'/usr/local/lib/csound/plugins-6.0/libtbvcf2.so'
(usr/local/lib/csound/plugins-6.0/libtbvcf2.so: undefined symbol:
csoundGetTypeForArg)

My guess is that I'm missing an include that defines IS_ASIG_ARG. My
source is attached.

Any thoughts?

Date2016-01-17 11:36
FromVictor Lazzarini
SubjectRe: [Csnd-dev] having a shot at fixing tbvcf
In plugins you need to use csound->GetTypeForArg() instead.
========================
Dr Victor Lazzarini
Dean of Arts, Celtic Studies and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952 

> On 17 Jan 2016, at 11:27, Peter Burgess  wrote:
> 
> Hi there, I thought I'd have a shot at fixing the sample rate issues
> with tbvcf. I've compiled my own version with a minor alteration. I'm
> getting a warning during compilation though, that is reflected by an
> error when I try to use the library in csound.
> 
> The two lines of code causing the warning are:
> 
>    p->fcocod = IS_ASIG_ARG(p->fco) ? 1 : 0;
>    p->rezcod = IS_ASIG_ARG(p->res) ? 1 : 0;
> 
> The compilation warning:
> 
> warning: implicit declaration of function ‘csoundGetTypeForArg’
> 
> The csound error:
> 
> WARNING: could not open llibrary
> '/usr/local/lib/csound/plugins-6.0/libtbvcf2.so'
> (usr/local/lib/csound/plugins-6.0/libtbvcf2.so: undefined symbol:
> csoundGetTypeForArg)
> 
> My guess is that I'm missing an include that defines IS_ASIG_ARG. My
> source is attached.
> 
> Any thoughts?

Date2016-01-17 11:41
FromPeter Burgess
SubjectRe: [Csnd-dev] having a shot at fixing tbvcf
cheers! that worked, but what I've done has broken it more, haha! I
knew it couldn't be that easy...

On Sun, Jan 17, 2016 at 11:36 AM, Victor Lazzarini
 wrote:
> In plugins you need to use csound->GetTypeForArg() instead.
> ========================
> Dr Victor Lazzarini
> Dean of Arts, Celtic Studies and Philosophy,
> Maynooth University,
> Maynooth, Co Kildare, Ireland
> Tel: 00 353 7086936
> Fax: 00 353 1 7086952
>
>> On 17 Jan 2016, at 11:27, Peter Burgess  wrote:
>>
>> Hi there, I thought I'd have a shot at fixing the sample rate issues
>> with tbvcf. I've compiled my own version with a minor alteration. I'm
>> getting a warning during compilation though, that is reflected by an
>> error when I try to use the library in csound.
>>
>> The two lines of code causing the warning are:
>>
>>    p->fcocod = IS_ASIG_ARG(p->fco) ? 1 : 0;
>>    p->rezcod = IS_ASIG_ARG(p->res) ? 1 : 0;
>>
>> The compilation warning:
>>
>> warning: implicit declaration of function ‘csoundGetTypeForArg’
>>
>> The csound error:
>>
>> WARNING: could not open llibrary
>> '/usr/local/lib/csound/plugins-6.0/libtbvcf2.so'
>> (usr/local/lib/csound/plugins-6.0/libtbvcf2.so: undefined symbol:
>> csoundGetTypeForArg)
>>
>> My guess is that I'm missing an include that defines IS_ASIG_ARG. My
>> source is attached.
>>
>> Any thoughts?

Date2016-01-17 11:49
FromPeter Burgess
SubjectRe: [Csnd-dev] having a shot at fixing tbvcf
This line appears twice in the code:

fc = fco1*(double)csound->onedsr*(44100.0/8.0);

onedsr is 1 / sr right? I thought it was odd firstly that it's got a
44100 hardcoded into it, and then even stranger that you would
multiply by 1 / sr and then multiply by sr.

That aside, I've tried compiling the original code to see if that
works, and my compiler tells me that csound has no member named
onedsr. Is this another plugin problem?

On Sun, Jan 17, 2016 at 11:41 AM, Peter Burgess
 wrote:
> cheers! that worked, but what I've done has broken it more, haha! I
> knew it couldn't be that easy...
>
> On Sun, Jan 17, 2016 at 11:36 AM, Victor Lazzarini
>  wrote:
>> In plugins you need to use csound->GetTypeForArg() instead.
>> ========================
>> Dr Victor Lazzarini
>> Dean of Arts, Celtic Studies and Philosophy,
>> Maynooth University,
>> Maynooth, Co Kildare, Ireland
>> Tel: 00 353 7086936
>> Fax: 00 353 1 7086952
>>
>>> On 17 Jan 2016, at 11:27, Peter Burgess  wrote:
>>>
>>> Hi there, I thought I'd have a shot at fixing the sample rate issues
>>> with tbvcf. I've compiled my own version with a minor alteration. I'm
>>> getting a warning during compilation though, that is reflected by an
>>> error when I try to use the library in csound.
>>>
>>> The two lines of code causing the warning are:
>>>
>>>    p->fcocod = IS_ASIG_ARG(p->fco) ? 1 : 0;
>>>    p->rezcod = IS_ASIG_ARG(p->res) ? 1 : 0;
>>>
>>> The compilation warning:
>>>
>>> warning: implicit declaration of function ‘csoundGetTypeForArg’
>>>
>>> The csound error:
>>>
>>> WARNING: could not open llibrary
>>> '/usr/local/lib/csound/plugins-6.0/libtbvcf2.so'
>>> (usr/local/lib/csound/plugins-6.0/libtbvcf2.so: undefined symbol:
>>> csoundGetTypeForArg)
>>>
>>> My guess is that I'm missing an include that defines IS_ASIG_ARG. My
>>> source is attached.
>>>
>>> Any thoughts?

Date2016-01-17 12:34
FromPeter Burgess
SubjectRe: [Csnd-dev] having a shot at fixing tbvcf
I'm pretty confused. I've made an example csd that works fine with
tbvcf, and then swapped it for my own tbvcf2. The only alterations
I've made is to alter both occurences of:

fc = fco1*(double)csound->onedsr*(44100.0/8.0);

I thought csound->onedsr would just be 1 / sr. So I've tried these two
alterations:

      fc   = fco1/8.0;

and

      MYFLT my_onedsr = 1 / csound->GetSr(csound);
      fc = fco1*my_onedsr*(44100.0/8.0);

I would have thought, as I am working at 44100 sr that these should
produce the same result as the original, but not so! I get NAN
amplitude on both versions. I feel I must have done something else
wrong, because I can't see why the second alteration should produce
anything other than the same result as the original.

On Sun, Jan 17, 2016 at 11:49 AM, Peter Burgess
 wrote:
> This line appears twice in the code:
>
> fc = fco1*(double)csound->onedsr*(44100.0/8.0);
>
> onedsr is 1 / sr right? I thought it was odd firstly that it's got a
> 44100 hardcoded into it, and then even stranger that you would
> multiply by 1 / sr and then multiply by sr.
>
> That aside, I've tried compiling the original code to see if that
> works, and my compiler tells me that csound has no member named
> onedsr. Is this another plugin problem?
>
> On Sun, Jan 17, 2016 at 11:41 AM, Peter Burgess
>  wrote:
>> cheers! that worked, but what I've done has broken it more, haha! I
>> knew it couldn't be that easy...
>>
>> On Sun, Jan 17, 2016 at 11:36 AM, Victor Lazzarini
>>  wrote:
>>> In plugins you need to use csound->GetTypeForArg() instead.
>>> ========================
>>> Dr Victor Lazzarini
>>> Dean of Arts, Celtic Studies and Philosophy,
>>> Maynooth University,
>>> Maynooth, Co Kildare, Ireland
>>> Tel: 00 353 7086936
>>> Fax: 00 353 1 7086952
>>>
>>>> On 17 Jan 2016, at 11:27, Peter Burgess  wrote:
>>>>
>>>> Hi there, I thought I'd have a shot at fixing the sample rate issues
>>>> with tbvcf. I've compiled my own version with a minor alteration. I'm
>>>> getting a warning during compilation though, that is reflected by an
>>>> error when I try to use the library in csound.
>>>>
>>>> The two lines of code causing the warning are:
>>>>
>>>>    p->fcocod = IS_ASIG_ARG(p->fco) ? 1 : 0;
>>>>    p->rezcod = IS_ASIG_ARG(p->res) ? 1 : 0;
>>>>
>>>> The compilation warning:
>>>>
>>>> warning: implicit declaration of function ‘csoundGetTypeForArg’
>>>>
>>>> The csound error:
>>>>
>>>> WARNING: could not open llibrary
>>>> '/usr/local/lib/csound/plugins-6.0/libtbvcf2.so'
>>>> (usr/local/lib/csound/plugins-6.0/libtbvcf2.so: undefined symbol:
>>>> csoundGetTypeForArg)
>>>>
>>>> My guess is that I'm missing an include that defines IS_ASIG_ARG. My
>>>> source is attached.
>>>>
>>>> Any thoughts?