MCPcopy Create free account
hub / github.com/danja/dogalog / createInstrumentsSection

Function createInstrumentsSection

src/ui/template.js:203–229  ·  view source on GitHub ↗

* Create the instruments section * @returns {HTMLElement}

()

Source from the content-addressed store, hash-verified

201 * @returns {HTMLElement}
202 */
203function createInstrumentsSection() {
204 const mapping = document.createElement('div');
205 mapping.className = 'mapping';
206
207 const instruments = [
208 { name: 'kick', desc: 'synthesized kick' },
209 { name: 'snare', desc: 'noise snare' },
210 { name: 'hat', desc: 'noise hat' },
211 { name: 'clap', desc: 'layered noise clap' },
212 { name: 'sine', desc: 'sine monosynth (use Pitch as MIDI)' },
213 { name: 'square', desc: 'square monosynth (use Pitch as MIDI)' },
214 { name: 'triangle', desc: 'triangle monosynth (use Pitch as MIDI)' },
215 { name: 'noise', desc: 'broadband noise burst (ignore Pitch)' }
216 ];
217
218 instruments.forEach(inst => {
219 const row = document.createElement('div');
220 row.className = 'row';
221 const code = document.createElement('code');
222 code.textContent = inst.name;
223 row.appendChild(code);
224 row.appendChild(document.createTextNode(' – ' + inst.desc));
225 mapping.appendChild(row);
226 });
227
228 return mapping;
229}

Callers 1

createMappingSectionFunction · 0.85

Calls 1

createElementMethod · 0.45

Tested by

no test coverage detected