It looks like you want to create or find an HTML-based chiptune tracker with features including:
- Adjustable BPM
- Customizable patterns with rows per pattern
- Multiple tracks/instruments
- Per instrument synth selection, maybe custom oscillator waveforms
- Volume, detune, ADSR envelope, filter & noise parameters per instrument/sound
- Ability to share the song (like via URL)
- Keyboard shortcuts
- Looping patterns or playback
- Probably to be lightweight and no demo or sample audio auto-playing
What you probably want:
- A web chiptune/music tracker app that is fully in HTML/JS — no server backend needed.
- Able to control synth parameters for instruments.
- Pattern-based tracker workflow with controls for BPM and rows.
- Share functionality — exporting song data as URL or similar.
- Keyboard shortcuts to speed up composing.
- Looping playback control.
- Light/no dependencies, small & clean.
There are existing projects that fit much of this — some open source, others web apps:
-
BeepBox (https://beepbox.co/)
- Web chiptune-like music maker, pattern-based with tracks and instruments.
- Has BPM, patterns, rows, synths (custom oscillator waveforms), volume, ADSR, filters.
- Can export/share URLs.
- Has basic keyboard shortcuts.
- Loops playback.
- Runs fully in-browser (HTML/JS).
- BUT it does have a demo/play interface, so maybe not fully what you want if you want no demo UI or autoplay.
-
JummBox (https://jummbus.com/)
- Web tracker style chiptune composer.
- Pattern/row-based, BPM control.
- Per instrument synth parameters.
- Share via URL.
- Keyboard shortcuts.
-
FamiTracker (Desktop) - not web, but popular chiptune tracker.
If you want a minimal custom solution or starter code example for your own HTML chiptune tracker:
Below is a basic outline/code snippet showing how to implement a simple chiptune tracker concept in HTML/JS with:
- BPM control
- Pattern/row structure
- Multiple instruments with synth parameters (oscillator, volume, detune, ADSR envelope)
- Basic filter & noise option
- Keyboard shortcuts for navigation and note entry
- Loop playback
- Shareable song data serialized in URL hash
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Simple HTML Chiptune Tracker</title>
<style>
body { font-family: monospace; background:#222; color:#eee; }
#tracker { max-width: 800px; margin: auto; display: grid; grid-template-columns: repeat(5,1fr); gap: 4px; }
.cell { background:#333; padding:4px; text-align:center; cursor:pointer; }
.cell.active { background:#0cf; }
#controls { margin: 10px auto; max-width: 800px; display:flex; gap:10px; }
label,input,select,button { font-family: monospace; font-size: 14px; }
</style>
</head>
<body>
<h1>Simple HTML Chiptune Tracker</h1>
<div id="controls">
<label>BPM <input type="number" id="bpm" value="120" min="30" max="300"/></label>
<label>Rows per Pattern <input type="number" id="rowsPerPattern" value="16" min="4" max="64"/></label>
<label>Current Pattern
<select id="patternSelect"></select>
</label>
<button id="playBtn">Play</button>
<button id="stopBtn">Stop</button>
<button id="addPatternBtn">Add Pattern</button>
<button id="shareBtn">Share</button>
</div>
<div id="instruments">
<h2>Instruments</h2>
</div>
<div id="tracker"></div>
<script>
// --- Basic Chiptune Tracker Core ---
const audioCtx = new (window.AudioContext || window.webkitAudioContext)();
const NOTES = [
'C-4','C#4','D-4','D#4','E-4','F-4','F#4','G-4','G#4','A-4','A#4','B-4',
'C-5'
];
// Convert note name to frequency
function noteToFreq(note) {
const noteMap = {C:0, 'C#':1, D:2, 'D#':3, E:4, F:5, 'F#':6, G:7, 'G#':8, A:9, 'A#':10, B:11};
let [name, octave] = [note.slice(0,-1), +note.slice(-1)];
return 440 * Math.pow(2, (noteMap[name] + (octave - 4)*12 - 9)/12);
}
// Tracker Data Structure
let song = {
bpm: 120,
rowsPerPattern: 16,
patterns: [
// Each pattern array: array of row objects, each has instrument and note data per channel
// Let's do 4channels for simplicity
],
instruments: [
{
name: 'Pulse 1',
oscType: 'square',
volume: 0.5,
detune: 0,
adsr: {attack:0.01, decay:0.1, sustain:0.3, release:0.2},
filter: {type:'lowpass', frequency: 1000},
noise: false
},
{
name: 'Triangle',
oscType: 'triangle',
volume: 0.4,
detune: 0,
adsr: {attack:0.01, decay:0.05, sustain:0.6, release:0.1},
filter: {type:'lowpass', frequency: 1500},
noise: false
}
],
channels: 4,
currentPattern: 0
};
// Initialize patterns with empty data
function initPatterns(numPatterns=1) {
song.patterns = [];
for(let p=0; p<numPatterns; p++) {
let pattern = [];
for(let i=0; i<song.rowsPerPattern; i++) {
let row = [];
for(let ch=0; ch<song.channels; ch++) {
row.push({note:null, instrument:0}); // no note initially
}
pattern.push(row);
}
song.patterns.push(pattern);
}
}
initPatterns(1);
// UI Elements
const bpmInput = document.getElementById('bpm');
const rowsInput = document.getElementById('rowsPerPattern');
const patternSelect = document.getElementById('patternSelect');
const trackerDiv = document.getElementById('tracker');
const instrumentsDiv = document.getElementById('instruments');
const playBtn = document.getElementById('playBtn');
const stopBtn = document.getElementById('stopBtn');
const addPatternBtn = document.getElementById('addPatternBtn');
const shareBtn = document.getElementById('shareBtn');
function updatePatternSelect() {
patternSelect.innerHTML = '';
for(let i=0; i<song.patterns.length; i++) {
let opt = document.createElement('option');
opt.value = i;
opt.textContent = `Pattern ${i}`;
patternSelect.appendChild(opt);
}
patternSelect.value = song.currentPattern;
}
updatePatternSelect();
function createInstrumentUI() {
const div = document.createElement('div');
div.innerHTML = '<h3>Instruments</h3>';
instrumentsDiv.innerHTML = '';
instrumentsDiv.appendChild(div);
song.instruments.forEach((ins, i) => {
let container = document.createElement('div');
container.style.border = '1px solid grey';
container.style.padding = '5px';
container.style.marginBottom = '5px';
container.innerHTML = `
<b>Instrument ${i}: ${ins.name}</b>
<br/>
Osc: <select data-index="${i}" class="oscSelect">
<option value="sine">Sine</option>
<option value="square">Square</option>
<option value="triangle">Triangle</option>
<option value="sawtooth">Sawtooth</option>
option value="custom">Custom</option>
</select>
Volume: <input type="range" min="0" max="1" step="0.01" value="${ins.volume}" data-index="${i}" class="volRange"/>
Detune: <input type="number" min="-100" max="100" value="${ins.detune}" data-index="${i}" class="detuneInput"/>
ADSR:
A <input type="number" min="0" max="2" step="0.01" value="${ins.adsr.attack}" data-index="${i}" class="adsrA" style="width:50px"/>
D <input type="number" min="0" max="2" step="0.01" value="${ins.adsr.decay}" data-index="${i}" class="adsrD" style="width:50px"/>
S <input type="number" min="0" max="1" step="0.01" value="${ins.adsr.sustain}" data-index="${i}" class="adsrS" style="width:50px"/>
R <input type="number" min="0" max="2" step="0.01" value="${ins.adsr.release}" data-index="${i}" class="adsrR" style="width:50px"/>
Filter cutoff: <input type="number" min="100" max="10000" step="10" value="${ins.filter.frequency}" data-index="${i}" class="filterFreq" />
Noise: <input type="checkbox" data-index="${i}" class="noiseChk" ${ins.noise ? 'checked' : ''}/>
`;
instrumentsDiv.appendChild(container);
});
// Attach event listeners for instrument inputs
instrumentsDiv.querySelectorAll('.oscSelect').forEach(sel=>{
sel.value = song.instruments[+sel.dataset.index].oscType;
sel.onchange = e => {
song.instruments[+e.target.dataset.index].oscType = e.target.value;
};
});
instrumentsDiv.querySelectorAll('.volRange').forEach(r=>{
r.oninput = e => {
song.instruments[+e.target.dataset.index].volume = +e.target.value;
};
});
instrumentsDiv.querySelectorAll('.detuneInput').forEach(r=>{
r.onchange = e => {
song.instruments[+e.target.dataset.index].detune = +e.target.value;
};
});
instrumentsDiv.querySelectorAll('.adsrA').forEach(i=>{
i.onchange = e => {
song.instruments[+e.target.dataset.index].adsr.attack = +e.target.value;
};
});
instrumentsDiv.querySelectorAll('.adsrD').forEach(i=>{
i.onchange = e => {
song.instruments[+e.target.dataset.index].adsr.decay = +e.target.value;
};
});
instrumentsDiv.querySelectorAll('.adsrS').forEach(i=>{
i.onchange = e => {
song.instruments[+e.target.dataset.index].adsr.sustain = +e.target.value;
};
});
instrumentsDiv.querySelectorAll('.adsrR').forEach(i=>{
i.onchange = e => {
song.instruments[+e.target.dataset.index].adsr.release = +e.target.value;
};
});
instrumentsDiv.querySelectorAll('.filterFreq').forEach(i=>{
i.onchange = e => {
song.instruments[+e.target.dataset.index].filter.frequency = +e.target.value;
};
});
instrumentsDiv.querySelectorAll('.noiseChk').forEach(i=>{
i.onchange = e => {
song.instruments[+e.target.dataset.index].noise = e.target.checked;
};
});
}
createInstrumentUI();
// Tracker grid render
function renderTracker() {
trackerDiv.innerHTML = '';
const pattern = song.patterns[song.currentPattern];
const rows = pattern.length;
const cols = song.channels;
trackerDiv.style.gridTemplateColumns = `20px repeat(${cols}, 60px)`;
// Header row
trackerDiv.appendChild(document.createElement('div')); // blank top-left
for(let c=0; c<cols; c++) {
const header = document.createElement('div');
header.textContent = `Ch ${c+1}`;
header.style.fontWeight = 'bold';
trackerDiv.appendChild(header);
}
for(let r=0; r<rows; r++) {
// Row number column
let rowNum = document.createElement('div');
rowNum.textContent = r.toString(16).toUpperCase().padStart(2,'0');
trackerDiv.appendChild(rowNum);
for(let c=0; c<cols; c++) {
let cell = document.createElement('div');
cell.className = 'cell';
let note = pattern[r][c].note;
let instr = pattern[r][c].instrument;
cell.textContent = note === null ? '---' : `${note} I${instr}`;
cell.dataset.row = r;
cell.dataset.col = c;
cell.addEventListener('click', () => {
// Cycle note on click for demo
let currentNoteIndex = NOTES.indexOf(pattern[r][c].note);
let nextNote = null;
if(currentNoteIndex === -1) nextNote = NOTES[0];
else if(currentNoteIndex === NOTES.length-1) nextNote = null;
else nextNote = NOTES[currentNoteIndex + 1];
pattern[r][c].note = nextNote;
renderTracker();
});
trackerDiv.appendChild(cell);
}
}
}
renderTracker();
// Instrument select for note entry shortcut (default to first instr)
let currentInstrument = 0;
// Keyboard shortcuts for note input
document.addEventListener('keydown', e => {
if(document.activeElement.tagName==='INPUT') return; // ignore typing in inputs
// Map keyboard rows to notes, e.g.asdfgh for C4-D#4
const keyMap = {
'a': 0, 'w':1, 's':2, 'e':3, 'd':4, 'f':5, 't':6, 'g':7,'y':8,'h':9,'u':10,'j':11,'k':12
};
if(keyMap.hasOwnProperty(e.key)) {
e.preventDefault();
const noteIndex = keyMap[e.key];
const noteName = NOTES[noteIndex];
// Put note in first row, first channel for demo
const pattern = song.patterns[song.currentPattern];
let row = 0, col = 0; // you might extend this with a cursor position
pattern[row][col].note = noteName;
pattern[row][col].instrument = currentInstrument;
renderTracker();
}
// Add more shortcuts as needed
});
// Play engine
let playing = false;
let timerId = undefined;
let currentRow = 0;
function playSound(note, instrument) {
if(!note) return;
let freq = noteToFreq(note);
let ins = song.instruments[instrument];
const osc = audioCtx.createOscillator();
osc.type = ins.oscType;
osc.frequency.setValueAtTime(freq, audioCtx.currentTime);
osc.detune.setValueAtTime(ins.detune, audioCtx.currentTime);
const gainNode = audioCtx.createGain();
// ADSR envelope
let now = audioCtx.currentTime;
const A = ins.adsr.attack, D = ins.adsr.decay, S = ins.adsr.sustain, R = ins.adsr.release;
gainNode.gain.setValueAtTime(0, now);
gainNode.gain.linearRampToValueAtTime(ins.volume, now + A);
gainNode.gain.linearRampToValueAtTime(ins.volume * S, now + A + D);
gainNode.gain.setTargetAtTime(0, now + A + D + 0.1, R);
osc.connect(gainNode);
// Filter
if(ins.filter) {
const filter = audioCtx.createBiquadFilter();
filter.type = ins.filter.type || 'lowpass';
filter.frequency.setValueAtTime(ins.filter.frequency, now);
gainNode.connect(filter);
filter.connect(audioCtx.destination);
} else {
gainNode.connect(audioCtx.destination);
}
osc.start(now);
osc.stop(now + A + D + R + 0.1);
}
// Playback per row
function scheduler() {
const interval = 60 / song.bpm / 4; // 16th note timing for 16 rows per pattern
const pattern = song.patterns[song.currentPattern];
if(currentRow >= pattern.length) currentRow = 0;
for(let ch=0; ch<song.channels; ch++) {
let step = pattern[currentRow][ch];
if(step.note) {
playSound(step.note, step.instrument);
}
}
currentRow++;
timerId = setTimeout(scheduler, interval * 1000);
}
playBtn.onclick = () => {
if(playing) return;
audioCtx.resume().then(()=>{
playing = true;
currentRow = 0;
scheduler();
});
};
stopBtn.onclick = () => {
playing = false;
clearTimeout(timerId);
timerId = undefined;
};
addPatternBtn.onclick = () => {
// Add empty pattern with current rows count
let newPattern = [];
for(let i=0; i<song.rowsPerPattern; i++) {
let row = [];
for(let ch=0; ch<song.channels; ch++) {
row.push({note:null,instrument:0});
}
newPattern.push(row);
}
song.patterns.push(newPattern);
song.currentPattern = song.patterns.length-1;
updatePatternSelect();
renderTracker();
};
patternSelect.onchange = e => {
song.currentPattern = +e.target.value;
renderTracker();
};
bpmInput.onchange = e => {
let bpm = +e.target.value;
if(bpm >= 30 && bpm <= 300) {
song.bpm = bpm;
}
};
rowsInput.onchange = e => {
let rows = +e.target.value;
if(rows >= 4 && rows <= 64) {
song.rowsPerPattern = rows;
// Re-init patterns to new row count, or better: resize existing
// For demo: re-init patterns
initPatterns(song.patterns.length);
renderTracker();
}
};
function serializeSong() {
// Very simple JSON + encodeURIComponent for URL hash
return encodeURIComponent(JSON.stringify(song));
}
function deserializeSong(str) {
try {
let obj = JSON.parse(decodeURIComponent(str));
if(obj && obj.bpm) return obj;
} catch(e) {}
return null;
}
shareBtn.onclick = () => {
const data = serializeSong();
window.history.replaceState(null,null, `/#${data}`);
alert('Song data saved in URL hash.');
};
// Load song from URL hash on load
window.addEventListener('load', () => {
if(location.hash.length > 1) {
let loaded = deserializeSong(location.hash.substr(1));
if(loaded) {
Object.assign(song, loaded);
updatePatternSelect();
createInstrumentUI();
renderTracker();
}
}
});
</script>
</body>
</html>
Notes:
-
This is a minimal demonstration - not a full tracker by any means, but shows how to handle:
- BPM
- Patterns with rows & channel cells
- Basic instrument parameters (oscillator, ADSR, filter)
- Playing notes with Web Audio API synths
- Keyboard shortcuts for note entry (simplified)
- Looping playback scheduler
- Share song data via URL hash
-
You can expand this with:
- More advanced UI and navigation (cursor, pattern chaining)
- Step editing and more complex note input
- Custom waveform generator in oscillator (using periodicWave)
- Adding noise channel/synth
- Saving/loading from file
- Multiple instruments and mixing
Summary
If you want to build your own tracker with your exact custom features, use the above as a starting point or explore projects like BeepBox or JummBox which already have many of these features in a polished form.
If you want me to help expand the above demo with any specific feature, just ask!