Csound Csound-dev Csound-tekno Search About

[Csnd] barmodel

Date2010-03-30 07:11
FromStefan Thomas
Subject[Csnd] barmodel
Dear community,
I have a question concerning the barmodel
The manual gives the example:
ares barmodel kbcL, kbcR, iK, ib, kscan, iT30, ipos, ivel, iwid

But where is there the amplitude, is it ivel?
And where is the frequency defined?
I guess it is a connection between two parameters, am I right?

Date2010-03-30 08:05
FromMark Van Peteghem
Subject[Csnd] Re: barmodel
Yes, ivel is the amplitude. But actually I use it as

ares barmodel ileft_end, iright_end, istiffness, ihf_loss, iscan_speed, \
        iT30db_decay, ipos, 0.012*iamp/istrike_width, istrike_width

because istrike_width seems to influence the amplitude as well.

For the frequency it's more complicated. This is just a model of how a 
metal bar sounds when it is hit. That has certain predominant 
frequencies as a consequence, but the parameters that are put in the 
model are not frequencies themselves. However, I did some experimenting 
and found that the stiffness parameter is proportional to the frequency. 
The proportionality factor only seems to depend on the first two 
parameters that specify how the bar is held at each end. Examining the 
length of the cycles by selecting 10 cycles in Audacity, for different 
values of the stiffness, I finally ended up with this:

if iright_end==1 then
    if ileft_end==1 then
        imsec = 2.41
    elseif ileft_end==2 then
        imsec = 3.825
    else
        imsec = 2.88
    endif
else
    if ileft_end==1 then
        imsec = 3.825
    elseif ileft_end==2 then
        imsec = 3.2
    else
        imsec = 4.398
    endif
endif

istiffness = ifreq*imsec/10

Note that this treats values of 2 and 3 for iright_end in the same way, 
but this is due to a bug in CSound 5.10 where the same signal was 
produced for these. I did not yet check if this has been solved already; 
if so I should add a case for when iright_end is 3.


Stefan Thomas wrote:
> Dear community,
> I have a question concerning the barmodel 
> 
> The manual gives the example:
> ares *barmodel* kbcL, kbcR, iK, ib, kscan, iT30, ipos, ivel, iwid
>
> But where is there the amplitude, is it ivel?
> And where is the frequency defined?
> I guess it is a connection between two parameters, am I right?