% Finite difference drum/chime % Bruce Land, Cornell University, May 2008 % second order scheme from % http://arxiv.org/PS_cache/physics/pdf/0009/0009068v2.pdf, % page 14, eqn 2.18 clear all %sound quality %changing the strike location and output location(s) also changes the quality % n rho eta alpha boundaryGain sound % 12 0.5 1e-4 1.0 0 chime % 12 0.5 2e-3 1.0 0 tin can % 12 0.5 2e-3 1.0 0.5 tin can % 6 0.5 2e-4 1.0 0.75 bell % 16 0.25 5e-4 0.1 0.0 drum % 16 0.05 2e-4 0.1 0.0 bass drum %square membrane frequency ratios f = [1, 1.58, 2, 2.24, 2.55, 2.92, 3, 3.16, 3.54, 3.6, 3.8, 4, 4.12, 4.3, 4.47, 4.5, 4.74, 5]; f0 = 0.161 ; %linear dimension of membrane -- bigger is lower pitch n = 20 ; u = zeros(n,n); %time t u1 = zeros(n,n); %time t-1 u2 = zeros(n,n); %time t-2 uHit = zeros(n,n); %input strike % 0 < rho < 0.5 -- lower rho => lower pitch % rho = (vel*dt/dx)^2 rho = 0.295 ; % eta = damping*dt/2 % higher damping => shorter sound eta = 0.0002 ; % boundary condition -1.0