It looks like you're describing a set of features or requirements for an HTML based chiptune tracker. Let me summarize and expand on what you might want, and then offer guidance or a sample starter code:
Features you mentioned:
- BPM (Beats Per Minute) control
- Rows per track
- Patterns
- Rows per pattern
- Synth per instrument
- Custom oscillator per instrument
- Volume control per instrument
- Detune per instrument
- ADSR envelope (Attack, Decay, Sustain, Release)
- Filter per instrument
- Noise channel
- Share song (probably via URL or hashed data)
- Shortcuts for UI usability
- Loop control
- Uses URL fragment for sharing (like "/#")
- No demo mode (possibly meaning no sample audio playback or no initial demo song loaded)
What is a chiptune tracker?
Chiptune trackers generally let users compose music with patterns and tracks, sequencing notes and effects with low-level synth or PCM instruments that resemble classic console sounds (e.g. NES, Game Boy).
A minimal tracker is an interface with grids (rows and columns), instruments, and playback controls.
What can I provide?
- An overview of how to build or code this kind of tracker in HTML/JS.
- A minimal example to get you started.
- Recommendations for libraries or resources.
- How to handle sharing via URL.
- How to implement playback with Web Audio API including oscillators, ADSR, filters, noise.
Let's outline a very simple, extensible chiptune tracker based on your features:
1. Data model
-
Song
- BPM
- Patterns (array)
- Instruments (array)
- Loop points
-
Pattern
- Rows (array of rows)
- Each row includes notes per track
-
Track
- Number of tracks per pattern
-
Instrument
- Synth type (oscillator type)
- Volume
- Detune
- ADSR envelope values
- Filter parameters
- Noise flag or noise synth for noise channels
2. Playback
- Use Web Audio API for synthesis.
- For noise, create buffer with random samples.
- Maintain a timer according to BPM and rows per pattern.
3. User Interface
- Grid for pattern editing (rows x tracks)
- Instrument editor with controls (oscillator, volume, detune, ADSR, filter)
- Playback controls (Play, Stop, Loop toggle)
- Keyboard shortcuts (e.g. space = play/stop, arrows to move, keys for note input)
- Share button to export song data as an encoded string in URL fragment (#)
4. Sharing
- Serialize song data (JSON string)
- Compress or base64 encode if necessary
- Put the encoded song into URL fragment (window.location.hash)
- On load, parse URL fragment and load song
5. No demo
- Start with empty song or last shared song in URL
- No preloaded demo song
Minimal Example Next Steps
Would you want me to provide a barebones HTML + JS example that implements:
- A small grid (e.g. 8 rows, 4 tracks)
- Basic instrument editor
- Playback using Web Audio API oscillator + ADSR
- Noise channel (white noise generator)
- URL sharing logic
- Simple keyboard shortcuts
If yes, let me know, and I will write a minimal but functional code snippet with explanations.
Alternatively, some resources/libraries you may want to check:
- Tone.js — helps with synths, ADSR, filters, noise.
- jsSID or Chiptune.js — libraries specifically for chiptune playback.
- Open Source trackers on GitHub for inspiration:
Summary
I can help build a custom HTML/JS chiptune tracker with these features. Please confirm or clarify:
- Do you want an example code?
- How many rows/tracks/patterns to demo?
- Which synth waveforms must be supported (sine, square, sawtooth, triangle)?
- Do you want note entry via keyboard or mouse only?
- Should sharing compress data or simple JSON base64?
Feel free to clarify!