It looks like you want to create or find an HTML-based chiptune tracker with specific features such as:
- BPM control
- Rows per track
- Patterns and rows per pattern
- Synth per instrument with custom oscillator
- Volume, detune, ADSR, filter, noise controls
- Song sharing capabilities
- Keyboard shortcuts
- Chord and loop support
- Exclusion of any demos (no demo mode)
Based on your requirements, here are some key points and options:
1. Existing Chiptune Trackers (HTML/JS)
There are already several open-source HTML5 chiptune trackers with rich features. Examples:
-
FamiTracker-Web (a web port of FamiTracker)
- Pros: Supports BPM, patterns, instruments with ADSR, volume, detune, custom samples
- Cons: Complexity, no chord dedicated interface
-
BeepBox (https://beepbox.co/)
- Pros: Browser-based, supports BPM, patterns, per-instrument synth and oscillator selection, volume, detune, filter, noise, chords, loops, keyboard shortcuts
- Cons: Less a tracker and more a sequencer, but very close to your feature list
-
JSChiptune - various open-source JS libraries for chiptune playback and simple editing.
2. Building Your Own Minimal HTML Chiptune Tracker
If you want to build a custom tracker yourself meeting all your criteria, here’s a very high-level outline:
Technologies:
- HTML + CSS + JavaScript (mostly Web Audio API)
- Canvas or DOM for UI display
- Use Web Audio Oscillators for synth generation (square, triangle, sawtooth, custom waveform)
- Implement sequencer grid: patterns → channels → instrument trigger rows
- Handle user input (mouse/keyboard)
- Store song data structures in JSON-like objects
Core Features Implementation Tips:
| Feature | How to Implement |
|---|
| BPM control | Use setInterval or requestAnimationFrame based stepping, adjust delay based on BPM |
| Rows per track | Define data model as arrays of steps, e.g. 64 rows per track |
| Patterns & rows per pattern | Organize track data in multiple patterns (2D arrays) |
| Synth per instrument | Use Web Audio Oscillator nodes per instrument, support multiple oscillator types (sine, square, etc) |
| Custom oscillator | Use custom waveforms via createPeriodicWave API |
| Volume | Gain nodes for volume control on each instrument channel |
| Detune | Web Audio oscillator detune property, controlled per instrument |
| ADSR envelope | Implement with gain node automation (gainNode.gain.setValueAtTime, etc.) |
| Filter | Use BiquadFilterNode |
| Noise | Create noise buffer and play via AudioBufferSourceNode when needed |
| Share song | Export/import JSON of song data, or URL encode song data for sharing |
| Shortcuts | Capture keyboard events with keydown event listeners |
| Chord support | Allow multiple notes per step |
| Loop | Implement playhead looping after reaching pattern end |
Minimal Example Snippet (Sequencing & Oscillator Setup)
<!DOCTYPE html>
<html>
<head><title>Minimal Chiptune Tracker</title></head>
<body>
<button id="play">Play</button>
<script>
const AudioCtx = window.AudioContext || window.webkitAudioContext;
const ctx = new AudioCtx();
// Song data example: 1 pattern, 1 channel, 8 rows; each row = freq or 0 (silence)
const pattern = [440, 0, 494, 0, 523, 0, 587, 0];
const bpm = 120;
const intervalMs = (60 / bpm) * 1000;
let currentStep = 0;
let playing = false;
let intervalId;
function playNote(freq) {
if (freq <= 0) return;
const osc = ctx.createOscillator();
const gain = ctx.createGain();
osc.type = 'square';
osc.frequency.setValueAtTime(freq, ctx.currentTime);
osc.detune.setValueAtTime(0, ctx.currentTime); // Add detune as needed
gain.gain.setValueAtTime(0.2, ctx.currentTime);
// Simple ADSR example
gain.gain.exponentialRampToValueAtTime(0.001, ctx.currentTime + 0.2);
osc.connect(gain).connect(ctx.destination);
osc.start(ctx.currentTime);
osc.stop(ctx.currentTime + 0.2);
}
function step() {
const freq = pattern[currentStep];
playNote(freq);
currentStep = (currentStep + 1) % pattern.length;
}
document.getElementById('play').onclick = () => {
if (!playing) {
currentStep = 0;
intervalId = setInterval(step, intervalMs);
playing = true;
} else {
clearInterval(intervalId);
playing = false;
}
}
</script>
</body>
</html>
This minimal example plays a simple pattern with square wave notes at given frequencies.
Useful Libraries/Tools to Extend:
- Tone.js (https://tonejs.github.io/) — simplifies Web Audio API, includes synth with ADSR, filter, detune, oscillator types.
- Wad.js — easier sound synthesis in browsers.
- MIDI.js or webmidi.io for MIDI support, if needed.
Summary
- For ready-to-use: try BeepBox or FamiTracker-Web.
- For custom build: use Web Audio API with data model of patterns/rows/instruments, connect oscillators, gain, filter nodes.
- Handle song data export/import to enable sharing.
- Use keyboard events for shortcuts.
- Use custom periodic waveforms or oscillator detune for sound flexibility.
- Implement your own loop and chord playback within your step sequencer.
If you want, I can help you create a more complete chiptune tracker prototype or guide you through adding specific features like ADSR envelopes, filters, or a pattern editor in code! Just ask.