Digital Music Programming II: digitar~This lab demonstrates how to build the first physical model intended for music.
To trigger a sound, whitenoise is typically inserted into the wavetable. For example, Here are 30 random starting samples which could initially fill a wavetable with 30 cells: 0.254541, -0.989285, 0.398697, -0.903335, -0.496827, 0.206703, -0.719541, 0.32735, 0.861006, -0.498739, 0.699209, 0.315953, -0.603312, 0.863098, -0.276961, 0.104826, 0.423026, -0.730595, 0.762872, 0.260196, -0.169276, 0.0591645, -0.44005, -0.140423, 0.576183, 0.0484494, 0.161253, -0.237088, 0.0730098, 0.841746 After the wavetable is read through once, the following values with be present in the wavetable after passing through the averaging filter (perhaps "backwards" in this case, but you get the idea). The edges of the wavetable wrap around, generating a "circular" wavetable for the purposes of filtering: -0.367372, -0.295294, -0.252319, -0.700081, -0.145062, -0.256419, -0.196096, 0.594178, 0.181134, 0.100235, 0.507581, -0.143679, 0.129893, 0.293069, -0.0860673, 0.263926, -0.153784, 0.0161388, 0.511534, 0.0454603, -0.0550557, -0.190443, -0.290237, 0.21788, 0.312316, 0.104851, -0.0379176, -0.0820391, 0.457378, 0.548144 By the 100th iteration of the averaging filter, the signal has a low amplitude and consists mostly of lower frequencies: 0.0799873, 0.0733677, 0.0673252, 0.0621212, 0.0576636, 0.0535048, 0.048906, 0.0429801, 0.0349083, 0.0241922, 0.0108834, -0.00427827, -0.0198742, -0.0339868, -0.0445269, -0.0496429, -0.048113, -0.0396228, -0.0248576, -0.00538518, 0.0166376, 0.0388566, 0.0591143, 0.075759, 0.0878144, 0.0950002, 0.0976314, 0.0964479, 0.0924264, 0.0866124 Here is an animated gif which shows the first 100 frames of the 30 cell wavetable after adjacent cells have been averaged at each step:
Here is a plot of the waveform generate by concatenating all of the wavetable contents in succession (click for larger view): |
Exercises
References
|