Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
playSound(msg, `${cmd}.wav`, cmd);
msg.channel.send(`${cmd} sample free here: ${link}`)
msg.reply("Now try combining the sample with another sample by typing `-fx build" + ` ${cmd}` + "`");
}
// ScribbleTune use
else if (cmd === "music") {
const scribble = require('scribbletune');
var clip = scribble.clip({
notes: 'c4'
});
scribble.midi(clip);
// const broadcast = client.createVoiceBroadcast();
// broadcast.playFile('fx.wav');
// for (const connection of client.voiceConnections.values()) {
// connection.playBroadcast(broadcast);
// console.log("Playing")
// }
}
// YouTube Integration
else if (cmd === "yt") {
var search_query = msg.content.slice(4, msg.content.length);
const { google } = require('googleapis');
const min = Math.min(...data);
const octaves = [...Array(5)].map((d, i) => i + 1); // [1, 2, 3, 4, 5]
// creates array of notes like 'c1', 'd1', 'e1', 'gb1', 'ab1', 'bb1', 'c2', ...
const notes = octaves.reduce((res, octave) =>
res.concat(scribble.scale('c', 'whole tone', octave, false))
, []);
const midiData = scribble.clip({
notes: data.map(value => notes[value - min]),
pattern: 'x',
noteLength: '1/16',
});
// write the MIDI file šµšµšµ
scribble.midi(midiData, 'data-sonification.mid');