47 | choose set
48 |
49 |
53 | 54 |55 |
${question}
25 |26 | 27 | 28 |
`); 29 | } 30 | 31 | export async function modalOkCancel(title, info, cancelText, okText) { 32 | return modal(` 33 |${info}
35 |36 | 37 | 38 |
`); 39 | } -------------------------------------------------------------------------------- /wasmaudioworklet/analyser/levelanalyser.spec.js: -------------------------------------------------------------------------------- 1 | import { connectLevelAnalyser, skipClipsWithinCentiSeconds } from './levelanalysernode.js'; 2 | 3 | describe('levelanalyser', async function () { 4 | this.timeout(10000); 5 | let stats; 6 | it('should analyse levels of audio input', async () => { 7 | const renderSampleRate = 44100; 8 | const duration = 5; 9 | const offlineCtx = new OfflineAudioContext(2, 10 | duration * renderSampleRate, 11 | renderSampleRate); 12 | 13 | const oscNode = new OscillatorNode(offlineCtx, { 14 | frequency: 440, channelCount: 2, 15 | type: "sine" 16 | }); 17 | oscNode.start(0); 18 | 19 | const gainNode = offlineCtx.createGain(); 20 | gainNode.gain.setValueAtTime(1.1, 0); 21 | oscNode.connect(gainNode); 22 | 23 | const getStats = await connectLevelAnalyser(gainNode); 24 | 25 | await offlineCtx.startRendering(); 26 | 27 | stats = await getStats(); 28 | console.log('found', stats.clips.length, 'clips. latest timestamp:', 29 | stats.clips[stats.clips.length - 1].currentTime, stats.clips[stats.clips.length - 1].time); 30 | 31 | assert(stats.clips.length > 0); 32 | }); 33 | it('display clips at least 10 milliseconds apart', async () => { 34 | expect(skipClipsWithinCentiSeconds(stats.clips).length).lessThan(stats.clips.length / 100); 35 | }); 36 | }); -------------------------------------------------------------------------------- /midi/recorder.js: -------------------------------------------------------------------------------- 1 | module.exports = function(recordingFileName) { 2 | const midi = require('midi'); 3 | 4 | // create a readable stream 5 | var stream1 = midi.createReadStream(); 6 | var input = new midi.input(); 7 | 8 | let inputIndex; 9 | 10 | for(var n=0;n| channel | 49 |instrument | 50 |select preset | 51 |
|---|
47 | choose set
48 |
49 |
53 | 54 |55 |