First time here? Check out the FAQ!
x

ModalFilter Vocal Formants BPFs revisited

0 votes
612 views

If you, like me, felt always uncomfortable editing the Prototype "ModalFilter Vocal Formants BPFs" you can download an easy-to-tweak version here: 

http://kyma.symbolicsound.com/library/modalfilter-vocal-formants-bpfs-revisited/

Comparing the code between the two versions:

Original

{5 * !Index into: #( {0 @ 609} {1 @ 400} {2 @ 238} {3 @ 325} {4 @ 360} {5 @ 415} {6 @ 300} {7 @ 400} )} {5 * !Index into: #( {0 @ 1000} {1 @ 1700} {2 @ 1741} {3 @ 700} {4 @ 750} {5 @ 1400} {6 @ 1600} {7 @ 1050} )} {5 * !Index into: #( {0 @ 2450} {1 @ 2300} {2 @ 2450} {3 @ 2550} {4 @ 2400} {5 @ 2200} {6 @ 2150} {7 @ 2200} )} {5 * !Index into: #( {0 @ 2700} {1 @ 2900} {2 @ 2900} {3 @ 2850} {4 @ 2675} {5 @ 2800} {6 @ 2700} {7 @ 2650} )} {5 * !Index into: #( {0 @ 3240} {1 @ 3400} {2 @ 4000} {3 @ 3100} {4 @ 2950} {5 @ 3300} {6 @ 3100} {7 @ 3100} )} 

Revisited

{
| index freqs nbrRows nbrColumns |

 

"Change this if you want to use a different hotValue or some CapyTalk expression.
The index is automatically normalized so 0 points to the first row and 1 to the last."
index := !Index. 

 

"Change freq values here, make sure they have the same number of columns.
Stick to the syntax if you are adding/changing things. Don't use hotValues here."
freqs := Array
with: #(609 1000 2450 2700 3240)
with: #(400 1700 2300 2900 3400)
with: #(238 1741 2450 2900 4000)
with: #(325 700 2550 2850 3100)
with: #(360 750 2400 2675 2950)
with: #(415 1400 2200 2800 3300)
with: #(300 1600 2150 2700 3100)
with: #(400 1050 2200 2650 3100).

 

"DO NOT CHANGE anything below (unless you have a good reason to do so)."


nbrRows := freqs size - 1.
nbrColumns := (freqs at: 1) size - 1.

0 to: nbrColumns collect: [ :col |
    | points |
    points := 0 to: nbrRows collect: [ :row |
        row @ (col of: (row of: freqs))
    ].
    ((index * nbrRows) into: points) hz
].
}

I also included a scripted version which is even easier to tweak ;)

 

@ssc: feel free to add / exchange this in the Kyma Prototypes

Also I realized that the Original version scales Index wrong (* 5 although there are 8 elements in the array). Another thing is that the ModeAmps are missing a column. I'm not sure if this is on purpose so I kept that.

 

Enjoy!

asked Mar 14, 2017 in Capytalk & Smalltalk by kymaguy (Virtuoso) (10,580 points)
Cool! Thanks Gus :)

This makes a lot more sense.

"You can use ModalFilter to model objects like rooms, strings, air columns, membranes, pieces of metal", "for which you can obtain data on the mode frequencies, amplitudes and bandwidths."  

One thing I found difficult about exploring the ModalFilter was finding sources of useful data as described in the help text. Does anyone know of good places or keywords to start looking for this data?
so I googled this: modal filter data
and the results are interesting.

https://link.springer.com/article/10.1007/s00419-012-0700-y
Another thing I've noticed while working on this is the calculation of the ModeBWs:

(frequency * 0.005 + 50) / frequency

The term "50 / frequency" calculates the BW value to get a width of 50 hz (+- the center freq). The term "frequency * 0.005" is added to the 50 to get some sort of frequency weighting, so the higher the frequency the broader the bandwidth.
However I always felt the higher frequencies are quite sharp and tend to ring easily. Putting in some values in the equation confirm that:

100 hz: 100 * 0.005 + 50 = 50.5 hz (again +- the center freq)
1000 hz: 1000 * 0.005 + 50 = 55 hz
4000 hz: 4000 * 0.005 + 50 = 70 hz
8000 hz: 8000 * 0.005 + 50 = 90 hz

The frequency weighting part is almost neglectable. Now that I have the easy-to-tweak version I was able to quickly test it without the frequency weighting, just using a fixed BW of 50 hz and I couldn't tell the difference!
Then I tried to change the weighting coefficient to 0.05 and indeed it sounded more natural to me, although I was able to tell some roughness of the GlottalPulse at the input which could be treated with a high-shelve filter maybe. If you calculate for the same values using 0.05 you would get:
100 hz: 55 hz
1000 hz: 100 hz
4000 hz: 250 hz
8000 hz: 450 hz

Still experimenting here! and always will ;)
Thanks, Gustl, your formulation is easier to read/understand/modify; we'll follow suit with the Prototype.
nice :) do you know why the last column for the ModeAmps is missing? I don't know where the data is from..

Please log in or register to answer this question.

...