It sounds like you’re looking for or wanting to build an HTML-based chiptune tracker with these features:
- BPM control
- Patterns with rows per pattern
- Multiple instruments each with their own synth
- Custom oscillator per instrument
- Volume, detune, ADSR envelope, filter, noise parameters
- Ability to share songs (export/import)
- Shortcuts like duplicate, delete, loop
- Support for pattern navigation with
/ and # or similar
- No demo mode or demo restrictions
Options to Consider
1. Existing Open Source Projects
There are some chiptune trackers in HTML/JS that are fairly advanced. They may not tick every box exactly but you can fork and extend:
Unless fully custom needed, BeepBox is quite close to your needs.
2. Building Your Own HTML Chiptune Tracker
If you want to build one yourself, here's a rough outline how to approach it:
Tech stack:
- Use Web Audio API for sound synthesis.
- Use Canvas or HTML elements + CSS for UI.
- Use JavaScript or TypeScript for logic.
Feature Implementation:
- BPM: Control playback timing with setInterval or requestAnimationFrame according to BPM.
- Patterns & Rows: Use 2D arrays to represent pattern data (rows × patterns).
- Synth per instrument: Each instrument is a set of oscillator settings + ADSR + filter + noise.
- Custom OSC: Set oscillator type (
sine, square, triangle, sawtooth, or custom waves).
- Volume & Detune: Control gain nodes and detune parameters of oscillators.
- ADSR: Implement using GainNode automation curves.
- Filter: Use BiquadFilterNode.
- Noise: Generate noise buffers or white noise source node.
- Pattern Commands: Implement keyboard shortcuts to duplicate (
dupe), delete, loop patterns.
- Navigation shortcuts (
/, #): Assign those keys to move between pattern banks or jump to rows.
- Sharing: Serialize all song data into JSON, export as string or URL param, import back via textarea or URL param.
Sample minimal code snippet (Web Audio API for one instrument):
js
class Instrument {
constructor(audioCtx) {
this.ctx = audioCtx;
this.oscType = 'square'; // 'sine', 'sawtooth', 'triangle', 'square'
this.volume = 0.3;
this.detune = 0;
this.adsr = {attack:0.01, decay:0.1, sustain:0.7, release:0.2};
this.filterFreq = 1000;
this.noiseOn = false;
}
playNote(freq, time, duration) {
const osc = this.ctx.createOscillator();
osc.type = this.oscType;
osc.frequency.setValueAtTime(freq, time);
osc.detune.setValueAtTime(this.detune, time);
const gain = this.ctx.createGain();
const filter = this.ctx.createBiquadFilter();
filter.type = 'lowpass';
filter.frequency.setValueAtTime(this.filterFreq, time);
osc.connect(filter);
filter.connect(gain);
gain.connect(this.ctx.destination);
// ADSR envelope
const {attack, decay, sustain, release} = this.adsr;
gain.gain.setValueAtTime(0, time);
gain.gain.linearRampToValueAtTime(this.volume, time + attack);
gain.gain.linearRampToValueAtTime(this.volume * sustain, time + attack + decay);
gain.gain.setValueAtTime(this.volume * sustain, time + duration - release);
gain.gain.linearRampToValueAtTime(0, time + duration);
osc.start(time);
osc.stop(time + duration);
}
}
// Usage example:
const audioCtx = new (window.AudioContext || window.webkitAudioContext)();
const instr = new Instrument(audioCtx);
instr.playNote(440, audioCtx.currentTime, 1);
Summary
- For immediate use: Try BeepBox.
- For learning/custom code: Build with Web Audio API as above.
- Include pattern logic and UI for rows/patterns.
- Add keyboard shortcuts for editing.
- Implement song JSON save/load for sharing.
If you want, I can help you develop a minimal chiptune tracker skeleton in HTML/JS with these features. Just tell me!