packages feed

hsc3-0.21: Help/Ugen/gammatone.help.hs

-- gammatone
X.gammatone (whiteNoiseId 'α' ar) 440 200 * 0.5

-- gammatone ; sweeping frequency of sine input
X.gammatone (sinOsc ar (mouseX kr 100 2000 Linear 0.2) 0) 1000 500 * 0.5

-- gammatone ; filters centered on 88 piano keys
let freqs = take 88 (map midiCps [21..])
    to_bw f = 24.7 * (f * 0.00437 + 1)
    bandwidths = map to_bw freqs
    -- calculated from ISO2002 100dB phon curve as approximation to sensitivity of outer ear
    outereargain = [0.080993772688853
                   ,0.089237063418603
                   ,0.097970525722848
                   ,0.10876266808815
                   ,0.12105360022674
                   ,0.13407538922284
                   ,0.14787149408674
                   ,0.16167718172822
                   ,0.17551213214451
                   ,0.19016975152285
                   ,0.20569895830538
                   ,0.22220242493157
                   ,0.2397154127401
                   ,0.2582697769952
                   ,0.27792744116278
                   ,0.29856170337058
                   ,0.32031587344117
                   ,0.34336361377938
                   ,0.36778184407609
                   ,0.39203618886184
                   ,0.41615498938524
                   ,0.44170796842
                   ,0.46878040665827
                   ,0.49446634124901
                   ,0.52001934250193
                   ,0.54709180427952
                   ,0.57577407840633
                   ,0.60165721569576
                   ,0.62782392863276
                   ,0.6555465952902
                   ,0.68491773749099
                   ,0.72411898089945
                   ,0.77354432147194
                   ,0.82590864573464
                   ,0.88138671475204
                   ,0.90157113760596
                   ,0.90157113760596
                   ,0.90157113760596
                   ,0.90157113760596
                   ,0.91510438365248
                   ,0.93321426408541
                   ,0.95240101404735
                   ,0.97272866753273
                   ,0.98926474289463
                   ,1.0053814152966
                   ,1.0224564349105
                   ,1.0405467880267
                   ,1.052760426677
                   ,1.061847894439
                   ,1.071475731154
                   ,1.0816760688321
                   ,1.0839269140212
                   ,1.0839269140212
                   ,1.0839269140212
                   ,1.0839269140212
                   ,1.0817917022137
                   ,1.0789305551391
                   ,1.0758992754061
                   ,1.0726877464002
                   ,1.0605734918597
                   ,1.0429115831426
                   ,1.0241994426808
                   ,1.0043746204451
                   ,0.95672713285027
                   ,0.89882037142901
                   ,0.83747029478932
                   ,0.77247215275345
                   ,0.75895909569467
                   ,0.74934344623004
                   ,0.73915602049396
                   ,0.72836281890006
                   ,0.75972195442662
                   ,0.81665861045357
                   ,0.87698089623035
                   ,0.94089013177825
                   ,1.022563004048
                   ,1.1129841925092
                   ,1.2087821046319
                   ,1.3102764570426
                   ,1.3485952672556
                   ,1.3833144995125
                   ,1.4200982447533
                   ,1.4590692653081
                   ,1.4180204618623
                   ,1.3674299412878
                   ,1.3138311518147
                   ,1.2570452124657
                   ,1.1677392221542]
in mix (X.gammatone (whiteNoiseId 'α' ar) (mce freqs) (mce bandwidths) * mce outereargain)