How to use scribbletune - 10 common examples

To help you get started, we’ve selected a few scribbletune examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github silvia-odwyer / Onyx / discordBot.js View on Github external
// Playback samples.
    else if (music_cmds.includes(cmd)) {
        console.log("playing")
        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);
github silvia-odwyer / Onyx / discordBot.js View on Github external
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');
github scribbletune / johann / src / api.ts View on Github external
export const getChord = (chordName) => {
	// concatenate chords from octave range 2 to 5
	var o2 = chord(chordName + '-2');
	var o3 = chord(chordName + '-3');
	var o4 = chord(chordName + '-4');
	var o5 = chord(chordName + '-5');
	return o2.concat(o3, o4, o5);
};
github scribbletune / johann / src / api.ts View on Github external
export const getChord = (chordName) => {
	// concatenate chords from octave range 2 to 5
	var o2 = chord(chordName + '-2');
	var o3 = chord(chordName + '-3');
	var o4 = chord(chordName + '-4');
	var o5 = chord(chordName + '-5');
	return o2.concat(o3, o4, o5);
};
github scribbletune / johann / src / api.ts View on Github external
export const getChord = (chordName) => {
	// concatenate chords from octave range 2 to 5
	var o2 = chord(chordName + '-2');
	var o3 = chord(chordName + '-3');
	var o4 = chord(chordName + '-4');
	var o5 = chord(chordName + '-5');
	return o2.concat(o3, o4, o5);
};
github scribbletune / johann / src / api.ts View on Github external
export const getChord = (chordName) => {
	// concatenate chords from octave range 2 to 5
	var o2 = chord(chordName + '-2');
	var o3 = chord(chordName + '-3');
	var o4 = chord(chordName + '-4');
	var o5 = chord(chordName + '-5');
	return o2.concat(o3, o4, o5);
};
github wbkd / from-data-to-sound / index.js View on Github external
const scribble = require('scribbletune');

// example data
const data = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 10, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1];

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');
github wbkd / from-data-to-sound / index.js View on Github external
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');
github scribbletune / johann / src / api.ts View on Github external
export const getScale = (rootNote, scaleName) => {
	// concatenate scales from octave range 1 to 6
	var o1 = scale(rootNote + 1 + ' ' + scaleName.toLowerCase()).map(sharpsToFlats);
	var o2 = scale(rootNote + 2 + ' ' + scaleName.toLowerCase()).map(sharpsToFlats);
	var o3 = scale(rootNote + 3 + ' ' + scaleName.toLowerCase()).map(sharpsToFlats);
	var o4 = scale(rootNote + 4 + ' ' + scaleName.toLowerCase()).map(sharpsToFlats);
	var o5 = scale(rootNote + 5 + ' ' + scaleName.toLowerCase()).map(sharpsToFlats);
	var o6 = scale(rootNote + 6 + ' ' + scaleName.toLowerCase()).map(sharpsToFlats);
	return o2.concat(o3, o4, o5, o6);
};
github wbkd / from-data-to-sound / index.js View on Github external
const notes = octaves.reduce((res, octave) =>
  res.concat(scribble.scale('c', 'whole tone', octave, false))
, []);

scribbletune

Create music with JavaScript and Node.js!

MIT
Latest version published 2 years ago

Package Health Score

53 / 100
Full package analysis