Skip to content

Commit 13f4cd1

Browse files
remove instrument wavetables that don't sound realistic
1 parent 6758592 commit 13f4cd1

2 files changed

Lines changed: 0 additions & 49 deletions

File tree

slider.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -108,10 +108,7 @@ class AudioInputTypeSlider extends Slider{
108108
this.slopeSel.option("lin");
109109
this.slopeSel.option("flat");
110110
this.slopeSel.option("log");
111-
this.slopeSel.option("flute");
112111
this.slopeSel.option("clarinet");
113-
this.slopeSel.option("french horn");
114-
this.slopeSel.option("violin");
115112
this.slopeSel.option("vowel a");
116113
this.slopeSel.option("vowel e");
117114
this.slopeSel.option("vowel i");

waves.js

Lines changed: 0 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -135,46 +135,6 @@ function calculateHarmonics(settings) {
135135
0.0001180637544273908, 0.0005814639905548997
136136
]
137137

138-
const frenchHornHarmonics = [
139-
0.23043554773427188, 0.6242410910690718, 1.0, 0.8554861416630004,
140-
0.6396172459304883, 0.5116344038715354, 0.4244610646722393, 0.29865816102067755,
141-
0.19071271447426308, 0.1496480422349318, 0.12175758908930928, 0.07521997360316762,
142-
0.04647162340519138, 0.03197096348438187, 0.015767707875054996, 0.01661020677518698,
143-
0.009472063352397713, 0.00906291245050594, 0.009069511658600968, 0.005954685437747471,
144-
0.004100307963044435, 0.004392872855257369, 0.004025516937967444, 0.003570171579410471,
145-
0.00291684997800264, 0.0012736471623405192, 0.0020875494940607127, 0.0014672239331280246,
146-
0.0008205015398152222, 0.00031896172459304885, 0.00042894852617685877, 0.00042454905411350635,
147-
0.0002001759788825341, 0.00022657281126264847, 0.00020897492300923887, 0.00010558732952045754,
148-
7.259128904531456e-05, 0.0002067751869775627, 0.00014078310602727673, 6.379234491860976e-05,
149-
5.9392872855257375e-05, 0.00010118785745710515, 2.419709634843819e-05, 0.00011218653761548615,
150-
8.798944126704795e-05, 9.458864936207654e-05, 0.00012758468983721952, 4.6194456665200174e-05,
151-
9.238891333040035e-05, 8.139023317201936e-05, 0.0001847778266608007, 0.00015618125824901012,
152-
0.0001913770347558293, 0.00015618125824901012, 0.00017817861856577212, 0.0002441706995160581,
153-
3.7395512538495386e-05, 2.8596568411790586e-05, 0.00014738231412230534, 0.00011658600967883854,
154-
0.00022657281126264847, 0.00012098548174219095, 0.0001253849538055433, 0.00011218653761548615,
155-
5.719313682358117e-05, 5.0593928728552574e-05, 8.798944126704795e-05, 0.0001539815222173339,
156-
9.678838539375275e-05, 0.00016058073031236252, 0.00014518257809062912, 5.279366476022877e-05
157-
];
158-
159-
fluteHarmonics = [
160-
1.0, 0.7543711967545639, 0.1576450304259635, 0.1966977687626775,
161-
0.1143265720081136, 0.0762657200811359, 0.012525354969574036, 0.009004056795131846,
162-
0.0065091277890466535, 0.003862068965517241, 0.002328600405679513, 0.002464503042596349,
163-
0.002342799188640974, 0.001308316430020284, 0.0006450304259634889, 0.0001338742393509128,
164-
0.0010304259634888438, 0.0005436105476673428, 0.00010750507099391482, 0.0009574036511156186,
165-
0.000744421906693712, 0.0005578093306288032, 0.0006754563894523326, 0.00043002028397565926,
166-
0.0003387423935091278
167-
];
168-
169-
violinHarmonics = [
170-
0.46135830072666295, 1.0, 0.8625675423886714, 0.29511645239426126,
171-
0.9508216880939073, 0.2635252468790758, 0.06555617663499161, 0.03791503633314701,
172-
0.0403204769890069, 0.06457611328488913, 0.006828768399478293, 0.006172908514999069,
173-
0.0010508664058133034, 0.0038755356810136017, 0.00038382709148500094, 0.0020029811812930873,
174-
0.004158747903856903, 0.002397987702627166, 0.0010527296441214832, 0.0009782001117942985,
175-
0.0007080305571082541, 0.0008999441028507547, 0.000456493385504006, 0.0008347307620644682
176-
]
177-
178138
for (let i = 0; i < settings.numHarm; i++) {
179139

180140
// the amplitude of each harmonic depends on the harmonic slope setting
@@ -186,12 +146,6 @@ function calculateHarmonics(settings) {
186146
harmonic_amplitude = Math.exp(-0.1 * (harmonic_number - 1));
187147
} else if (settings.harmSlope === "clarinet") {
188148
harmonic_amplitude = i < clarinetHarmonics.length ? clarinetHarmonics[i] : 0;
189-
} else if (settings.harmSlope === "french horn") {
190-
harmonic_amplitude = i < frenchHornHarmonics.length ? frenchHornHarmonics[i] : 0;
191-
} else if (settings.harmSlope === "flute") {
192-
harmonic_amplitude = i < fluteHarmonics.length ? fluteHarmonics[i] : 0;
193-
} else if (settings.harmSlope === "violin") {
194-
harmonic_amplitude = i < violinHarmonics.length ? violinHarmonics[i] : 0;
195149
} else if (settings.harmSlope === "vowel a") {
196150
harmonic_amplitude = formantFrequencyStrength(harmonic_number * settings.fundFreq,
197151
850, 1610, 0.2);

0 commit comments

Comments
 (0)