|
// This file contains the source code for the instruments executed by the song patterns |
|
// as press, release and frame (held) events. |
|
// Compiling this file using the provided build.zig will generate instruments.wat, |
|
// which is referred by the song's InstrumentsFile setting. |
|
|
|
const std = @import("std"); |
|
const math = std.math; |
|
const ct = @import("ct"); |
|
const gba = ct.gba; |
|
|
|
fn toIntFreq(comptime float_freq: f32) u32 { |
|
return @intFromFloat(float_freq * 256); |
|
} |
|
|
|
// Approximation of semitone frequency ratios using integer fractions |
|
// at compile time to avoid floating point operations on the GBA. |
|
const semitone_128th = [_]u32{ |
|
@intFromFloat(math.round(128.0 * math.pow(f32, 2, 0.0 / 12.0))), |
|
@intFromFloat(math.round(128.0 * math.pow(f32, 2, 1.0 / 12.0))), |
|
@intFromFloat(math.round(128.0 * math.pow(f32, 2, 2.0 / 12.0))), |
|
@intFromFloat(math.round(128.0 * math.pow(f32, 2, 3.0 / 12.0))), |
|
@intFromFloat(math.round(128.0 * math.pow(f32, 2, 4.0 / 12.0))), |
|
@intFromFloat(math.round(128.0 * math.pow(f32, 2, 5.0 / 12.0))), |
|
@intFromFloat(math.round(128.0 * math.pow(f32, 2, 6.0 / 12.0))), |
|
@intFromFloat(math.round(128.0 * math.pow(f32, 2, 7.0 / 12.0))), |
|
@intFromFloat(math.round(128.0 * math.pow(f32, 2, 8.0 / 12.0))), |
|
@intFromFloat(math.round(128.0 * math.pow(f32, 2, 9.0 / 12.0))), |
|
@intFromFloat(math.round(128.0 * math.pow(f32, 2, 10.0 / 12.0))), |
|
@intFromFloat(math.round(128.0 * math.pow(f32, 2, 11.0 / 12.0))), |
|
@intFromFloat(math.round(128.0 * math.pow(f32, 2, 12.0 / 12.0))), |
|
}; |
|
|
|
fn arpeggio_cs5_e5(freq: u32, t: u32, chan: gba.Channel) void { |
|
if (t > 1) { |
|
const f = switch (t % 4) { |
|
1 => freq, |
|
2 => toIntFreq(555.4), |
|
3 => toIntFreq(662.0), |
|
0 => freq * 2, |
|
else => unreachable, |
|
}; |
|
gba.CtrlFreq.init().withSquareFreq(f).writeTo(chan); |
|
} |
|
} |
|
|
|
fn vibrato(delay: u32, p: u16, freq: u32, t: u32) u32 { |
|
// Use almost half a semitone (0.475) amplitude for the delta triangle wave. |
|
const ratio = comptime @as(u32, @intFromFloat(math.round(1 / (math.pow(f32, 1.0594630943592953, 0.475) - 1)))); |
|
const a = freq / ratio; |
|
const delta = 1 + 4 * a / p * @abs(@mod((@mod(@as(i32, @intCast(t - delay)) - p / 4, p) + p), p) - p / 2) - a; |
|
return freq + delta; |
|
} |
|
|
|
var glide_base_freq: u32 = 0; |
|
var glide_next_freq: u32 = 0; |
|
|
|
fn glide(period: u32, freq: u32, t: u32) u32 { |
|
if (glide_base_freq != 0) { |
|
const s_freq: i32 = @intCast(freq); |
|
const s_base: i32 = @intCast(glide_base_freq); |
|
const s_t: i32 = @intCast(t); |
|
const s_period: i32 = @intCast(period); |
|
return @intCast(@divTrunc((s_freq - s_base) * s_t, s_period) + s_base); |
|
} else { |
|
return freq; |
|
} |
|
} |
|
|
|
const square1_1 = struct { |
|
pub const id: [*:0]const u8 = "S1"; |
|
|
|
pub fn press(freq: u32, _: u8, _: i8, _: i8) callconv(.C) void { |
|
gba.EnvDutyLen.init() |
|
.withEnvStart(11) |
|
.withEnvDir(gba.env_dec) |
|
.withEnvInterval(2) |
|
.withDuty(gba.dut_3_4) |
|
.writeTo(gba.square1); |
|
gba.CtrlFreq.init() |
|
.withTrigger(1) |
|
.withSquareFreq(freq) |
|
.writeTo(gba.square1); |
|
} |
|
|
|
pub fn frame(freq: u32, _: u8, t: u32) callconv(.C) void { |
|
arpeggio_cs5_e5(freq, t, gba.square1); |
|
} |
|
}; |
|
|
|
const square1_2 = struct { |
|
pub const id: [*:0]const u8 = "S2"; |
|
pub fn press(freq: u32, _: u8, _: i8, _: i8) callconv(.C) void { |
|
gba.EnvDutyLen.init() |
|
.withEnvStart(13) |
|
.withEnvDir(gba.env_dec) |
|
.withEnvInterval(7) |
|
.withDuty(gba.dut_3_4) |
|
.writeTo(gba.square1); |
|
gba.CtrlFreq.init() |
|
.withTrigger(1) |
|
.withSquareFreq(freq) |
|
.writeTo(gba.square1); |
|
} |
|
|
|
pub fn frame(freq: u32, _: u8, t: u32) callconv(.C) void { |
|
if (t % 14 == 0) { |
|
if (t % 28 == 0) |
|
gba.CtrlFreq.init().withSquareFreq(freq).writeTo(gba.square1) |
|
else |
|
gba.CtrlFreq.init().withSquareFreq(freq * 271 / 256).writeTo(gba.square1); |
|
} |
|
} |
|
}; |
|
|
|
const square2_1 = struct { |
|
pub const id: [*:0]const u8 = "T1"; |
|
|
|
pub fn press(freq: u32, _: u8, _: i8, _: i8) callconv(.C) void { |
|
gba.EnvDutyLen.init() |
|
.withEnvStart(15) |
|
.withEnvDir(gba.env_dec) |
|
.withEnvInterval(7) |
|
.withDuty(gba.dut_1_4) |
|
.writeTo(gba.square2); |
|
gba.CtrlFreq.init() |
|
.withSquareFreq(freq * 2) |
|
.withTrigger(1) |
|
.writeTo(gba.square2); |
|
} |
|
|
|
pub fn frame(freq: u32, _: u8, t: u32) callconv(.C) void { |
|
const delay = 36; |
|
if (t > delay) { |
|
gba.CtrlFreq.init() |
|
.withSquareFreq(vibrato(delay, 8, freq, t)) |
|
.writeTo(gba.square2); |
|
} else if (t == 2) { |
|
gba.CtrlFreq.init() |
|
.withSquareFreq(freq) |
|
.writeTo(gba.square2); |
|
} |
|
} |
|
}; |
|
|
|
const square2_2 = struct { |
|
pub const id: [*:0]const u8 = "T2"; |
|
|
|
pub fn press(freq: u32, _: u8, _: i8, _: i8) callconv(.C) void { |
|
gba.EnvDutyLen.init() |
|
.withEnvStart(13) |
|
.withEnvDir(gba.env_dec) |
|
.withEnvInterval(4) |
|
.withDuty(gba.dut_1_4) |
|
.writeTo(gba.square2); |
|
gba.CtrlFreq.init() |
|
.withSquareFreq(freq * 2) |
|
.withTrigger(1) |
|
.writeTo(gba.square2); |
|
} |
|
|
|
pub fn frame(freq: u32, _: u8, t: u32) callconv(.C) void { |
|
const delay = 15; |
|
if (t > delay) { |
|
gba.CtrlFreq.init() |
|
.withSquareFreq(vibrato(delay, 8, freq, t)) |
|
.writeTo(gba.square2); |
|
} else if (t == 2) { |
|
gba.CtrlFreq.init() |
|
.withSquareFreq(freq) |
|
.writeTo(gba.square2); |
|
} |
|
} |
|
}; |
|
|
|
const square2_3 = struct { |
|
pub const id: [*:0]const u8 = "T3"; |
|
|
|
pub fn press(freq: u32, _: u8, _: i8, _: i8) callconv(.C) void { |
|
gba.EnvDutyLen.init() |
|
.withEnvStart(15) |
|
.withEnvDir(gba.env_dec) |
|
.withEnvInterval(2) |
|
.withDuty(gba.dut_2_4) |
|
.writeTo(gba.square2); |
|
gba.CtrlFreq.init() |
|
.withSquareFreq(freq) |
|
.withTrigger(1) |
|
.writeTo(gba.square2); |
|
} |
|
|
|
pub fn frame(freq: u32, _: u8, t: u32) callconv(.C) void { |
|
gba.CtrlFreq.init() |
|
.withFreq(gba.square2.encodeFreq(freq) - @as(u11, @truncate(0x30 * t))) |
|
.writeTo(gba.square2); |
|
} |
|
}; |
|
|
|
const triangle_table = gba.wav(0x0123456789abcdeffedcba9876543210); |
|
const angled_flat_table = gba.wav(0xfedcba98765432100000000011111111); |
|
const angled_square_table = gba.wav(0xfedcba987654321000000000ffffffff); |
|
const square_table = gba.wav(0xffff0000ffff0000ffff0000ffff0000); |
|
const jaggy_table = gba.wav(0xff880088ff8800880807060506070809); |
|
|
|
// Single wave release implementation. |
|
fn wave_simple_r(freq: u32, _: u8, _: u32) callconv(.C) void { |
|
gba.WaveVolLen.init() |
|
.withVolume(gba.vol_0) |
|
.writeTo(gba.wave); |
|
gba.CtrlFreq.init() |
|
.withWaveFreq(freq) |
|
.withTrigger(1) |
|
.writeTo(gba.wave); |
|
glide_next_freq = freq; |
|
} |
|
|
|
var wave_glide_period: u32 = 0; |
|
var wave_vibrato_period: u16 = 0; |
|
|
|
/// Common glide+vibrato implementation shared by instruments differing only by their wave table. |
|
fn wave_glide_vibrato_p(freq: u32, _: u8, p0: i8, p1: i8) callconv(.C) void { |
|
glide_base_freq = freq * 128 / semitone_128th[@as(usize, @intCast(p0)) % semitone_128th.len]; |
|
|
|
gba.WaveVolLen.init() |
|
.withVolume(gba.vol_100) |
|
.writeTo(gba.wave); |
|
gba.CtrlFreq.init() |
|
.withWaveFreq(glide_base_freq) |
|
.withTrigger(1) |
|
.writeTo(gba.wave); |
|
|
|
wave_glide_period = @intCast((@as(usize, @intCast(p0)) % semitone_128th.len) * 8); |
|
wave_vibrato_period = @intCast(p1); |
|
} |
|
fn wave_glide_vibrato_r(freq: u32, _: u8, t: u32) callconv(.C) void { |
|
gba.WaveVolLen.init() |
|
.withVolume(gba.vol_0) |
|
.writeTo(gba.wave); |
|
gba.CtrlFreq.init() |
|
.withWaveFreq(freq) |
|
.withTrigger(1) |
|
.writeTo(gba.wave); |
|
|
|
if (wave_glide_period != 0 and t <= wave_glide_period) { |
|
// Adjust the next glide base if we released within the glide. |
|
glide_next_freq = glide(wave_glide_period, freq, t); |
|
} else { |
|
glide_next_freq = freq; |
|
} |
|
} |
|
fn wave_glide_vibrato_f(freq: u32, _: u8, t: u32) callconv(.C) void { |
|
const vibrato_delay = 49; |
|
if (wave_glide_period != 0 and t <= wave_glide_period) { |
|
gba.CtrlFreq.init() |
|
.withWaveFreq(glide(wave_glide_period, freq, t)) |
|
.writeTo(gba.wave); |
|
} else if (t > vibrato_delay and wave_vibrato_period > 0) { |
|
gba.CtrlFreq.init() |
|
.withWaveFreq(vibrato(vibrato_delay, wave_vibrato_period, freq, t)) |
|
.writeTo(gba.wave); |
|
} |
|
} |
|
|
|
const wave_1 = struct { |
|
pub const id: [*:0]const u8 = "W1"; |
|
|
|
pub fn press(freq: u32, note: u8, p0: i8, p1: i8) callconv(.C) void { |
|
gba.WaveRam.setTable(&triangle_table); |
|
wave_glide_vibrato_p(freq, note, p0, p1); |
|
} |
|
|
|
pub const release = wave_glide_vibrato_r; |
|
pub const frame = wave_glide_vibrato_f; |
|
pub const param_0 = ct.Parameter{ .name = "Glide (semitones)", .min = 0, .max = 12, .default = 1 }; |
|
pub const param_1 = ct.Parameter{ .name = "VP Vibrato Period", .min = 0, .default = 8 }; |
|
}; |
|
|
|
const wave_2 = struct { |
|
pub const id: [*:0]const u8 = "W2"; |
|
|
|
pub fn press(freq: u32, _: u8, _: i8, _: i8) callconv(.C) void { |
|
gba.WaveRam.setTable(&angled_flat_table); |
|
gba.WaveVolLen.init() |
|
.withVolume(gba.vol_100) |
|
.writeTo(gba.wave); |
|
gba.CtrlFreq.init() |
|
.withWaveFreq(freq * 2) |
|
.withTrigger(1) |
|
.writeTo(gba.wave); |
|
} |
|
|
|
pub fn frame(freq: u32, _: u8, t: u32) callconv(.C) void { |
|
if (t == 1) |
|
gba.CtrlFreq.init() |
|
.withWaveFreq(freq) |
|
.withTrigger(1) |
|
.writeTo(gba.wave); |
|
} |
|
}; |
|
|
|
const wave_3 = struct { |
|
pub const id: [*:0]const u8 = "W3"; |
|
|
|
pub fn press(freq: u32, note: u8, p0: i8, p1: i8) callconv(.C) void { |
|
gba.WaveRam.setTable(&angled_flat_table); |
|
wave_glide_vibrato_p(freq, note, p0, p1); |
|
} |
|
|
|
pub const release = wave_glide_vibrato_r; |
|
pub const frame = wave_glide_vibrato_f; |
|
pub const param_0 = ct.Parameter{ .name = "Glide (semitones)", .min = 0, .max = 12, .default = 1 }; |
|
pub const param_1 = ct.Parameter{ .name = "VP Vibrato Period", .min = 0, .default = 8 }; |
|
}; |
|
|
|
const wave_4 = struct { |
|
pub const id: [*:0]const u8 = "W4"; |
|
|
|
pub fn press(freq: u32, _: u8, _: i8, _: i8) callconv(.C) void { |
|
// Only bounce and glide if we got a next base freq and if it's higher than freq |
|
glide_base_freq = if (glide_next_freq != 0 and glide_next_freq > freq) glide_next_freq else freq; |
|
|
|
gba.WaveRam.setTable(&angled_flat_table); |
|
gba.WaveVolLen.init() |
|
.withVolume(gba.vol_100) |
|
.writeTo(gba.wave); |
|
gba.CtrlFreq.init() |
|
.withWaveFreq(glide_base_freq) |
|
.withTrigger(1) |
|
.writeTo(gba.wave); |
|
} |
|
|
|
pub const release = wave_simple_r; |
|
|
|
pub fn frame(freq: u32, _: u8, t: u32) callconv(.C) void { |
|
const period_up = 3; |
|
const period_down = 9; |
|
if (t <= period_up + period_down) { |
|
if (glide_base_freq != 0) { |
|
const up_freq = glide_base_freq + (glide_base_freq - freq); |
|
if (t <= period_up) { |
|
// Bounce up from freq (not implemented) |
|
const f = (up_freq - glide_base_freq) * t / period_up + glide_base_freq; |
|
gba.CtrlFreq.init() |
|
.withWaveFreq(f) |
|
.writeTo(gba.wave); |
|
} else { |
|
// Interpolate to back into freq |
|
const f = up_freq - (up_freq - freq) * (t - period_up) / period_down; |
|
gba.CtrlFreq.init() |
|
.withWaveFreq(f) |
|
.writeTo(gba.wave); |
|
} |
|
} |
|
} |
|
} |
|
}; |
|
|
|
const wave_5 = struct { |
|
pub const id: [*:0]const u8 = "W5"; |
|
|
|
pub fn press(freq: u32, note: u8, p0: i8, p1: i8) callconv(.C) void { |
|
gba.WaveRam.setTable(&angled_square_table); |
|
wave_glide_vibrato_p(freq, note, p0, p1); |
|
} |
|
|
|
pub const release = wave_glide_vibrato_r; |
|
pub const frame = wave_glide_vibrato_f; |
|
pub const param_0 = ct.Parameter{ .name = "Glide (semitones)", .min = 0, .max = 12, .default = 1 }; |
|
pub const param_1 = ct.Parameter{ .name = "VP Vibrato Period", .min = 0, .default = 8 }; |
|
}; |
|
|
|
const wave_6 = struct { |
|
pub const id: [*:0]const u8 = "W6"; |
|
|
|
pub fn press(freq: u32, _: u8, _: i8, _: i8) callconv(.C) void { |
|
gba.WaveRam.setTable(&jaggy_table); |
|
gba.WaveVolLen.init() |
|
.withVolume(gba.vol_50) |
|
.writeTo(gba.wave); |
|
gba.CtrlFreq.init() |
|
.withWaveFreq(freq) |
|
.withTrigger(1) |
|
.writeTo(gba.wave); |
|
} |
|
pub const release = wave_simple_r; |
|
}; |
|
|
|
const wave_7 = struct { |
|
pub const id: [*:0]const u8 = "W7"; |
|
|
|
pub fn press(freq: u32, _: u8, _: i8, _: i8) callconv(.C) void { |
|
gba.WaveRam.setTable(&square_table); |
|
gba.WaveVolLen.init() |
|
.withVolume(gba.vol_25) |
|
.writeTo(gba.wave); |
|
gba.CtrlFreq.init() |
|
.withWaveFreq(freq) |
|
.withTrigger(1) |
|
.writeTo(gba.wave); |
|
} |
|
|
|
pub const release = wave_simple_r; |
|
|
|
pub fn frame(freq: u32, _: u8, t: u32) callconv(.C) void { |
|
const delay = 49; |
|
if (t > delay) |
|
gba.CtrlFreq.init() |
|
.withWaveFreq(vibrato(delay, 8, freq, t)) |
|
.writeTo(gba.wave); |
|
} |
|
}; |
|
|
|
const noise_1 = struct { |
|
pub const id: [*:0]const u8 = "N1"; |
|
|
|
pub fn press(_: u32, _: u8, _: i8, _: i8) callconv(.C) void { |
|
gba.EnvDutyLen.init() |
|
.withEnvStart(7) |
|
.withEnvDir(gba.env_dec) |
|
.withEnvInterval(1) |
|
.writeTo(gba.noise); |
|
gba.NoiseCtrlFreq.init() |
|
.withTrigger(1) |
|
.writeTo(gba.noise); |
|
} |
|
|
|
pub fn frame(_: u32, _: u8, t: u32) callconv(.C) void { |
|
switch (t) { |
|
0 => (gba.NoiseCtrlFreq{ .freq = 1 }).writeTo(gba.noise), |
|
1 => (gba.NoiseCtrlFreq{ .freq = 2 }).writeTo(gba.noise), |
|
2 => (gba.NoiseCtrlFreq{ .freq = 1 }).writeTo(gba.noise), |
|
3 => (gba.NoiseCtrlFreq{ .freq = 2 }).writeTo(gba.noise), |
|
4 => (gba.NoiseCtrlFreq{ .freq = 1 }).writeTo(gba.noise), |
|
// 5 |
|
6 => (gba.NoiseCtrlFreq{ .freq = 2 }).writeTo(gba.noise), |
|
7 => (gba.NoiseCtrlFreq{ .freq = 1 }).writeTo(gba.noise), |
|
8 => (gba.NoiseCtrlFreq{ .freq = 2 }).writeTo(gba.noise), |
|
else => {}, |
|
} |
|
} |
|
}; |
|
|
|
const noise_2 = struct { |
|
pub const id: [*:0]const u8 = "N2"; |
|
|
|
pub fn press(_: u32, _: u8, _: i8, _: i8) callconv(.C) void { |
|
gba.EnvDutyLen.init() |
|
.withEnvStart(10) |
|
.withEnvDir(gba.env_dec) |
|
.withEnvInterval(1) |
|
.writeTo(gba.noise); |
|
gba.NoiseCtrlFreq.init() |
|
.withTrigger(1) |
|
.writeTo(gba.noise); |
|
} |
|
|
|
pub fn frame(_: u32, _: u8, t: u32) callconv(.C) void { |
|
switch (t) { |
|
0 => (gba.NoiseCtrlFreq{ .freq = 5, .width = gba.wid_7, .freq_div = gba.div_16 }).writeTo(gba.noise), |
|
1 => (gba.NoiseCtrlFreq{ .freq = 5, .width = gba.wid_7, .freq_div = gba.div_48 }).writeTo(gba.noise), |
|
// 2 |
|
3 => (gba.NoiseCtrlFreq{ .freq = 5, .width = gba.wid_7, .freq_div = gba.div_80 }).writeTo(gba.noise), |
|
4 => (gba.NoiseCtrlFreq{ .freq = 5, .width = gba.wid_7, .freq_div = gba.div_112 }).writeTo(gba.noise), |
|
5 => (gba.NoiseCtrlFreq{ .freq = 6, .width = gba.wid_15, .freq_div = gba.div_8 }).writeTo(gba.noise), |
|
else => {}, |
|
} |
|
} |
|
}; |
|
|
|
const noise_3 = struct { |
|
pub const id: [*:0]const u8 = "N3"; |
|
|
|
pub fn press(_: u32, _: u8, _: i8, _: i8) callconv(.C) void { |
|
gba.EnvDutyLen.init() |
|
.withEnvStart(10) |
|
.withEnvDir(gba.env_dec) |
|
.withEnvInterval(2) |
|
.writeTo(gba.noise); |
|
gba.NoiseCtrlFreq.init() |
|
.withTrigger(1) |
|
.writeTo(gba.noise); |
|
} |
|
|
|
pub fn frame(_: u32, _: u8, t: u32) callconv(.C) void { |
|
switch (t) { |
|
0 => (gba.NoiseCtrlFreq{ .freq = 5, .width = gba.wid_7, .freq_div = gba.div_16 }).writeTo(gba.noise), |
|
1 => (gba.NoiseCtrlFreq{ .freq = 7, .width = gba.wid_7, .freq_div = gba.div_16 }).writeTo(gba.noise), |
|
2 => (gba.NoiseCtrlFreq{ .freq = 6, .width = gba.wid_7, .freq_div = gba.div_16 }).writeTo(gba.noise), |
|
3 => (gba.NoiseCtrlFreq{ .freq = 5, .width = gba.wid_15, .freq_div = gba.div_8 }).writeTo(gba.noise), |
|
// 4 |
|
5 => (gba.NoiseCtrlFreq{ .freq = 5, .width = gba.wid_15, .freq_div = gba.div_16 }).writeTo(gba.noise), |
|
6 => (gba.NoiseCtrlFreq{ .freq = 4, .width = gba.wid_15, .freq_div = gba.div_16 }).writeTo(gba.noise), |
|
7 => (gba.NoiseCtrlFreq{ .freq = 5, .width = gba.wid_15, .freq_div = gba.div_16 }).writeTo(gba.noise), |
|
else => {}, |
|
} |
|
} |
|
}; |
|
|
|
const noise_4 = struct { |
|
pub const id: [*:0]const u8 = "N4"; |
|
|
|
pub fn press(_: u32, _: u8, _: i8, _: i8) callconv(.C) void { |
|
gba.EnvDutyLen.init() |
|
.withEnvStart(7) |
|
.withEnvDir(gba.env_dec) |
|
.withEnvInterval(2) |
|
.writeTo(gba.noise); |
|
gba.NoiseCtrlFreq.init() |
|
.withTrigger(1) |
|
.writeTo(gba.noise); |
|
} |
|
|
|
pub fn frame(_: u32, _: u8, t: u32) callconv(.C) void { |
|
switch (t) { |
|
0 => (gba.NoiseCtrlFreq{ .freq = 1, .freq_div = gba.div_16 }).writeTo(gba.noise), |
|
1 => (gba.NoiseCtrlFreq{ .freq = 1, .freq_div = gba.div_32 }).writeTo(gba.noise), |
|
2 => (gba.NoiseCtrlFreq{ .freq = 1, .freq_div = gba.div_48 }).writeTo(gba.noise), |
|
3 => (gba.NoiseCtrlFreq{ .freq = 1, .freq_div = gba.div_64 }).writeTo(gba.noise), |
|
4 => (gba.NoiseCtrlFreq{ .freq = 1, .freq_div = gba.div_80 }).writeTo(gba.noise), |
|
else => {}, |
|
} |
|
} |
|
}; |
|
|
|
pub fn main() void { |
|
ct.registerInstrument(square1_1, 0); |
|
ct.registerInstrument(square1_2, 0); |
|
ct.registerInstrument(square2_1, 0); |
|
ct.registerInstrument(square2_2, 0); |
|
ct.registerInstrument(square2_3, 1); |
|
ct.registerInstrument(wave_1, 1); |
|
ct.registerInstrument(wave_2, 1); |
|
ct.registerInstrument(wave_3, 1); |
|
ct.registerInstrument(wave_4, 2); |
|
ct.registerInstrument(wave_5, 2); |
|
ct.registerInstrument(wave_6, 2); |
|
ct.registerInstrument(wave_7, 2); |
|
ct.registerInstrument(noise_1, 3); |
|
ct.registerInstrument(noise_2, 3); |
|
ct.registerInstrument(noise_3, 3); |
|
ct.registerInstrument(noise_4, 3); |
|
} |