Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
async function warmUpModel() {
await mvae.initialize();
// Warm up the model.
const ns = {notes: [{pitch:60, velocity: 100, startTime: 0, endTime: 1}]}
const quantizedNS = mmcore.sequences.quantizeNoteSequence(ns, 4);
await drumify(quantizedNS, 80);
app.listen(PORT, function() {
console.log('Your app is listening on port ' + PORT);
});
}
function fixSequence(ns) {
// unquantized -> quantized -> unquantized
const quant = mmcore.sequences.quantizeNoteSequence(ns, 4);
const unquant = mmcore.sequences.unquantizeSequence(quant);
for (let i = 0; i < unquant.notes.length; i++) {
delete unquant.notes[i].quantizedStartStep;
delete unquant.notes[i].quantizedEndStep;
}
delete unquant.totalQuantizedSteps;
delete unquant.quantizationInfo;
return unquant;
}