Skip to content

Commit 2a64918

Browse files
dwursteisenclaude
andcommitted
replace custom instruments with retro game presets
Replace generic custom1-4 placeholder instruments with meaningful retro video game presets: bass (PULSE), lead (SQUARE), pluck (TRIANGLE), and snare (NOISE), each with tuned ADSR envelopes and harmonic profiles. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 23c56c7 commit 2a64918

File tree

1 file changed

+34
-33
lines changed
  • tiny-engine/src/commonMain/kotlin/com/github/minigdx/tiny/sound

1 file changed

+34
-33
lines changed

tiny-engine/src/commonMain/kotlin/com/github/minigdx/tiny/sound/Music.kt

Lines changed: 34 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ class Music(
1414
violon,
1515
obos,
1616
drum,
17-
custom1,
18-
custom2,
19-
custom3,
20-
custom4,
17+
bass,
18+
lead,
19+
pluck,
20+
snare,
2121
null,
2222
null,
2323
null,
@@ -101,50 +101,51 @@ val drum =
101101
harmonics = floatArrayOf(1f),
102102
)
103103

104-
val custom1 =
104+
val bass =
105105
Instrument(
106106
index = 4,
107-
name = "custom1",
107+
name = "bass",
108108
wave = Instrument.WaveType.PULSE,
109-
attack = 0.1f,
110-
decay = 0.1f,
111-
sustain = 0.9f,
112-
release = 0.05f,
113-
harmonics = floatArrayOf(1f, 0.05f, 0.01f),
109+
dutyCycle = 0.25f,
110+
attack = 0.005f,
111+
decay = 0.15f,
112+
sustain = 0.6f,
113+
release = 0.1f,
114+
harmonics = floatArrayOf(1.0f, 0.5f, 0.25f, 0.12f, 0.06f, 0.0f, 0.0f),
114115
)
115116

116-
val custom2 =
117+
val lead =
117118
Instrument(
118119
index = 5,
119-
name = "custom2",
120-
wave = Instrument.WaveType.SAW_TOOTH,
121-
attack = 0.1f,
122-
decay = 0.1f,
123-
sustain = 0.9f,
124-
release = 0.05f,
125-
harmonics = floatArrayOf(1f, 0.05f, 0.01f),
120+
name = "lead",
121+
wave = Instrument.WaveType.SQUARE,
122+
attack = 0.01f,
123+
decay = 0.08f,
124+
sustain = 0.85f,
125+
release = 0.15f,
126+
harmonics = floatArrayOf(1.0f, 0.0f, 0.45f, 0.0f, 0.25f, 0.0f, 0.15f),
126127
)
127128

128-
val custom3 =
129+
val pluck =
129130
Instrument(
130131
index = 6,
131-
name = "custom3",
132+
name = "pluck",
132133
wave = Instrument.WaveType.TRIANGLE,
133-
attack = 0.1f,
134-
decay = 0.1f,
135-
sustain = 0.9f,
136-
release = 0.05f,
137-
harmonics = floatArrayOf(1f, 0.05f, 0.01f),
134+
attack = 0.002f,
135+
decay = 0.2f,
136+
sustain = 0.05f,
137+
release = 0.08f,
138+
harmonics = floatArrayOf(1.0f, 0.4f, 0.3f, 0.15f, 0.08f, 0.04f, 0.02f),
138139
)
139140

140-
val custom4 =
141+
val snare =
141142
Instrument(
142143
index = 7,
143-
name = "custom4",
144-
wave = Instrument.WaveType.SQUARE,
145-
attack = 0.1f,
146-
decay = 0.1f,
147-
sustain = 0.9f,
144+
name = "snare",
145+
wave = Instrument.WaveType.NOISE,
146+
attack = 0.001f,
147+
decay = 0.08f,
148+
sustain = 0.1f,
148149
release = 0.05f,
149-
harmonics = floatArrayOf(1f, 0.05f, 0.01f),
150+
harmonics = floatArrayOf(1.0f, 0.8f, 0.5f, 0.3f),
150151
)

0 commit comments

Comments
 (0)