/ proof-of-concept / toy-instruments
Sign in
proof-of-concept / toy-instruments
toy-instruments / src / instruments / bead-string / presets.ts
90 lines · 2.3 KBCodeBlameHistory
3const steel: StringParams = {
4 n: 50,
5 spacing: 0.0127, // 0.65 m wall to wall
6 mass: 5.08e-5, // 4 g/m, like a guitar G string
7 k: 3.15e6, // EA / L for steel, 0.5 mm diameter
8 tension: 70,
9 leftEnd: 'clamped',
10 rightEnd: 'clamped',
11 pins: '',
12 t60Low: 4,
13 fLow: 100,
14 t60High: 0.6,
15 fHigh: 4000,
16 excitation: 'pluck',
17 excBead: 10,
18 excWidth: 1,
19 pluckAmp: 0.002,
20 strikeVel: 2,
21 hammerForce: 20,
22 hammerMs: 1,
23 excAngle: 0,
24 pickupMode: 'bead',
25 pickupBead: 4,
26 pickupAxis: 'y',
27 duration: 2,
28 fs: 48000,
29 cfl: 0.5,
30 frameRate: 2000,
31};
33export interface Preset {
34 name: string;
35 description: string;
36 params: StringParams;
39export const PRESETS: Preset[] = [
40 {
41 name: 'Steel string, plucked',
42 description: 'Guitar-like: 50 beads, 0.65 m, 70 N, ~102 Hz. Stiff springs, so longitudinal modes sit near 2.4 kHz.',
43 params: steel,
44 },
45 {
46 name: 'Steel string, fretted at the middle',
47 description: 'Same string with bead 25 pinned: an octave up, each half rings on its own.',
48 params: { ...steel, pins: '25', excBead: 6, pickupBead: 3 },
49 },
50 {
51 name: 'Steel string, hammered',
52 description: '1 ms raised-cosine force near one end, like a piano hammer (no hammer felt or contact).',
53 params: { ...steel, excitation: 'hammer', excBead: 6, excWidth: 1, hammerForce: 30, hammerMs: 1.5 },
54 },
55 {
56 name: 'Rubber band, big pluck',
57 description: 'Soft springs, 100% pre-stretch: transverse and longitudinal speeds are close, so a large pluck glides in pitch and couples the two.',
58 params: {
59 ...steel,
60 n: 30,
61 spacing: 0.01,
62 mass: 1e-4,
63 k: 8000,
64 tension: 40,
65 pluckAmp: 0.03,
66 excBead: 8,
67 t60Low: 1.5,
68 t60High: 0.3,
69 },
70 },
71 {
72 name: 'Three beads',
73 description: 'A very coarse string: three modes only, at inharmonic ratios 1 : 1.85 : 2.41.',
74 params: {
75 ...steel,
76 n: 3,
77 spacing: 0.1625,
78 mass: 0.00065,
79 k: 2.5e5,
80 excBead: 1,
81 pickupBead: 1,
82 frameRate: 4000,
83 },
84 },
85 {
86 name: 'Whirling string',
87 description: 'Plucked at 30 degrees out of plane with sliding ends: watch the y and z views and the pitch of each.',
88 params: { ...steel, n: 40, spacing: 0.016, leftEnd: 'clamped', rightEnd: 'sliding', excAngle: 30, pluckAmp: 0.008, mass: 6.4e-5 },
89 },
90];
↑↓ move↵openescclose