It looks like you're interested in creating or using a HTML-based chiptune tracker with features including:
- BPM control
- Patterns and rows per pattern
- Synth parameters per instrument (custom waveform, oscillator, volume, detune, ADSR envelope, filter, noise)
- Sharing songs
- Shortcuts for operations like duplicate, delete, loop
- Possibly avoiding demos or templates ("no demo")
- URL hashes ("/#") for sharing or song state
Are you looking for a recommendation of an existing tool, or help building one yourself?
If you want an existing HTML5 chiptune tracker with those features:
Popular HTML5 Chiptune Trackers with many of these features:
-
BeepBox
- URL: https://beepbox.co/
- Features: BPM, patterns/rows, multiple instruments, waveforms, ADSR, filter, noise, URL share via hash, keyboard shortcuts for duplicate/delete/loop etc.
- Pro: Very user friendly, well maintained
- Con: Limited to built-in instrument types (can't do full custom osc synthesis)
-
jsfxr (more sound generator than tracker)
- Might be combined with trackers or editors
- Not full tracker interface
-
FamiTracker (Windows app only)
- Worth mentioning but not HTML based
-
WebSID and MilkyTracker are less web-friendly or not HTML-based.
If you want to build a simple HTML/JS tracker yourself:
High-level strategy:
-
UI:
- Pattern editor grid: rows x columns for different instruments
- Controls for BPM and rows-per-pattern
- Instrument editor: waveform selector, oscillator settings (detune, volume), ADSR envelope sliders, filter controls, noise amount
-
Sound Engine:
- Use Web Audio API OscillatorNode for waveform generation
- Use GainNode for volume and ADSR envelopes
- Use BiquadFilterNode for filtering
- Noise generator with scriptProcessor or AudioWorklet
-
Controls and shortcuts:
- Implement keyboard shortcuts for dup/delete/loop commands
- Implement loop playback of patterns
-
Sharing:
- Serialize song state (BPM, patterns, instruments, settings) as a JSON string, encode to base64 or URI component, and append as
/#<encoded_data> in URL
- On load, parse URL hash, decode and load song
-
No demo:
- Start with an empty/default song or your own starting state
Example Libraries and references:
- Tone.js: simplifies Web Audio API handling
- Howler.js: simpler audio playback, might be limited for synthesis
- jsfxr: for sound effect generation
Sample minimal code outline for building such a tracker:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>Simple Chiptune Tracker</title>
<style>
/* basic styles for grid and controls */
#patternEditor { display: grid; grid-template-columns: repeat(8, 40px); }
.cell { width: 40px; height: 24px; border: 1px solid #ccc; text-align: center; }
#instrumentEditor, #controls { margin-top: 10px; }
</style>
</head>
<body>
<h1>Simple Chiptune Tracker</h1>
<div>
BPM: <input type="number" id="bpm" value="120" min="30" max="300" />
Rows per pattern: <input id="rowsPerPattern" type="number" value="16" min="4" max="64" />
</div>
<div id="patternEditor"></div>
<div id="instrumentEditor">
<h2>Instrument 1</h2>
Waveform:
<select id="waveformSelect">
<option value="sine">Sine</option>
<option value="square">Square</option>
<option value="sawtooth">Sawtooth</option>
<option value="triangle">Triangle</option>
</select><br/>
Volume: <input type="range" id="volume" min="0" max="1" step="0.01" value="0.5" /><br/>
Detune: <input type="range" id="detune" min="-1200" max="1200" step="1" value="0" /><br/>
ADSR: Attack <input type="range" id="attack" min="0" max="2" step="0.01" value="0.01" />
Decay <input type="range" id="decay" min="0" max="2" step="0.01" value="0.1" />
Sustain <input type="range" id="sustain" min="0" max="1" step="0.01" value="0.5" />
Release <input type="range" id="release" min="0" max="2" step="0.01" value="0.3" />
</div>
<button id="playBtn">Play</button>
<button id="stopBtn">Stop</button>
<script>
// Basic oscillator with ADSR envelope & simple pattern
let audioCtx = new (window.AudioContext || window.webkitAudioContext)();
let isPlaying = false;
let bpm = 120;
let rowsPerPattern = 16;
let currentStep = 0;
let timerId;
// Example pattern: Array of frequencies or null (rest)
let pattern = [262, 294, 330, 349, 392, 440, 494, 523, null, null, null, null, null, null, null, null];
// Grab controls
const bpmInput = document.getElementById("bpm");
const rowsInput = document.getElementById("rowsPerPattern");
const playBtn = document.getElementById("playBtn");
const stopBtn = document.getElementById("stopBtn");
bpmInput.onchange = () => {
bpm = parseInt(bpmInput.value);
if(isPlaying) { stop(); play(); }
};
rowsInput.onchange = () => {
rowsPerPattern = parseInt(rowsInput.value);
};
function play() {
if (isPlaying) return;
isPlaying = true;
const interval = (60 / bpm) / 4 * 1000; // 16th notes timing
currentStep = 0;
timerId = setInterval(() => {
playNote(pattern[currentStep]);
currentStep++;
if(currentStep >= rowsPerPattern) currentStep = 0;
}, interval);
}
function stop() {
isPlaying = false;
clearInterval(timerId);
}
function playNote(freq) {
if (!freq) return;
let osc = audioCtx.createOscillator();
let gainNode = audioCtx.createGain();
osc.type = document.getElementById("waveformSelect").value;
osc.frequency.setValueAtTime(freq, audioCtx.currentTime);
gainNode.gain.setValueAtTime(0, audioCtx.currentTime);
gainNode.gain.linearRampToValueAtTime(parseFloat(document.getElementById("volume").value), audioCtx.currentTime + parseFloat(document.getElementById("attack").value));
gainNode.gain.linearRampToValueAtTime(parseFloat(document.getElementById("sustain").value), audioCtx.currentTime + parseFloat(document.getElementById("attack").value) + parseFloat(document.getElementById("decay").value));
// release ramp when stopping is not demonstrated here for simplicity
osc.connect(gainNode).connect(audioCtx.destination);
osc.start();
osc.stop(audioCtx.currentTime + 0.2);
}
playBtn.onclick = play;
stopBtn.onclick = stop;
</script>
</body>
</html>
Next Steps if you want:
- Implement pattern editor grid UI allowing click to add/remove notes
- Multiple instruments
- Saving/loading from URL hash
- More advanced audio processing (detune, filter, noise)
- Keyboard shortcuts for managing patterns (duplicate, delete, loop toggle)
If you want, I can help write specific functionalities or help you find a ready-made tracker or sound engine library matching those criteria. Just let me know!