My first ditty! Tried to replicate the score from musescore.com/user/2912581/scores/950701
Log in to post a comment.
// // RTFM You can find the DittyToy API Reference here: https://dittytoy.net/syntax // const hands = { leftHand: { one: [ //lows [11, [[a4, 4]]], [1, [[a4, 2], [a4, 1], [gs4, 1]]], [1, [[fs4, 4]]], [1, [[fs4, 2], [fs4, 1], [e4, 1]]], [1, [[d4, 4]]], [1, [[d4, 2], [d4, 1], [cs4, 1]]], [1, [[b3, 2], [a3, 2]]], [1, [[gs3, 2], [e3, 2]]], [1, [[a3, 4]]], [1, [[a3, 4]]], [4, [[a3, 4]]], [1, [[b3, 4]]], [1, [[gs3, 4]]], [1, [[a3, 4]]], [1, [[a3, 2], [a3, 1], [gs3, 1]]], [1, [[fs3, 4]]], [1, [[fs3, 2], [fs3, 1], [e3, 1]]], [1, [[d3, 4]]], [1, [[d3, 2], [d3, 1], [cs3, 1]]], [1, [[b2, 2], [a2, 2]]], [1, [[gs2, 2], [e2, 2]]], [2, [[a2, 4]]], [2, [[a3, 4]]], [2, [[c3, 4]]], [1, [[c3, 8]]], [1, [[d3, 4]]], [1, [[g3, 4]]], [1, [[c3, 4]]], [1, [[c3, 2], [c3, 1], [b2, 1]]], [1, [[a2, 4]]], [1, [[a2, 2], [a2, 1], [g2, 1]]], [1, [[f2, 4]]], [1, [[f2, 2], [f3, 1], [e3, 1]]], [1, [[d3, 4]]], [1, [[g2, 4]]], [1, [[c3, 4]]], [13, [[c4, 4]]], [1, [[c4, 2], [c2, 2]]], [2, [[false, 4]]], ], two: [ //highs [4, [[false, .5], [e5,1], [e5, 1], [e5, 1], [e5, .5]]], [2, [[false, .5], [e5,1], [e5, 1], [e5, 1], [e5, .5]]], [2, [[false, .5], [fs5,1], [fs5, 1], [fs5, 1], [fs5, .5]]], [1, [[false, .5], [fs5,1], [fs5, 1], [fs5, 1], [fs5, .5]]], [2, [[false, .5], [e5,1], [e5, 1], [e5, 1], [e5, .5]]], [1, [[false, .5], [e5,1], [e5, .5], [false, .5], [e5,1], [e5, .5]]], [1, [[false, .5], [cs5,1], [cs5, 1], [cs5, 1], [cs5, .5]]], [1, [[false, .5], [cs5,1], [cs5, .5], [false, .5], [cs5, 1], [cs5, .5]]], [1, [[false, .5], [a4,1], [a4, 1], [a4, 1], [a4, .5]]], [1, [[false, .5], [a4,1], [a4, .5], [false, .5], [a4, 1], [a4, .5]]], [2, [[false, .5], [fs4,1], [fs4, .5], [false, .5], [fs4, 1], [fs4, .5]]], [2, [[false, .5], [e4,1], [e4, 1], [e4, 1], [e4, .5]]], [2, [[false, .5], [e4,1], [e4, 1], [e4, 1], [e4, .5]]], [2, [[false, .5], [fs4,1], [fs4, 1], [fs4, 1], [fs4, .5]]], [1, [[false, .5], [fs4,1], [fs4, 1], [fs4, 1], [fs4, .5]]], [2, [[false, .5], [e4,1], [e4, 1], [e4, 1], [e4, .5]]], [1, [[false, .5], [e4,1], [e4, .5], [false, .5], [e4, 1], [e4, .5]]], [1, [[false, .5], [cs4,1], [cs4, 1], [cs4, 1], [cs4, .5]]], [1, [[false, .5], [cs4,1], [cs4, .5], [false, .5], [cs4, 1], [cs4, .5]]], [1, [[false, .5], [a3,1], [a3, 1], [a3, 1], [a3, .5]]], [1, [[false, .5], [a3,1], [a3, .5], [false, .5], [a3, 1], [a3, .5]]], [1, [[false, .5], [fs3,1], [fs3, .5], [false, .5], [fs3, 1], [fs3, .5]]], [1, [[false, .5], [e3,1], [e3, .5], [false, .5], [e3, 1], [e3, .5]]], [2, [[false, .5], [e3,1], [e3, 1], [e3, 1], [e3, .5]]], [2, [[false, .5], [e4,1], [e4, 1], [e4, 1], [e4, .5]]], [2, [[false, .5], [g3, .5], [e4, .5], [g3, .5], [e4, .5], [g3, .5], [e4, .5], [g3, .5]]], [1, [[false, .5], [a3, .5], [f4, .5], [a3, .5], [e4, .5], [a3, .5], [e4, .5], [a3, .5]]], [1, [[d4, .5], [a3, .5], [d4, .5], [a3, .5], [c4, .5], [a3, .5], [c4, .5], [a3, .5]]], [1, [[false, .5], [a3, .5], [f4, .5], [a3, .5], [f4, .5], [a3, .5], [f4, .5], [a3, .5]]], [1, [[false, .5], [d4, .5], [g4, .5], [d4, .5], [b4, .5], [d4, .5], [c4, .5], [d4, .5]]], [1, [[false, .5], [g3, .5], [e4, .5], [g3, .5], [e4, .5], [g3, .5], [e4, .5], [g3, .5]]], [1, [[false, .5], [g3, .5], [e4, .5], [g3, .5], [false, .5], [g3, 1], [g3, .5]]], [1, [[false, .5], [e3, .5], [c4, .5], [e3, .5], [e4, .5], [e3, .5], [c4, .5], [e3, .5]]], [1, [[false, .5], [e3, .5], [c4, .5], [e3, .5], [false, .5], [e3, 1], [e3, .5]]], [1, [[false, .5], [c3, .5], [a3, .5], [c3, .5], [g3, .5], [c3, .5], [a3, .5], [c3, .5]]], [1, [[false, .5], [c3, .5], [a3, .5], [c3, .5], [false, .5], [c4, 1], [c4, .5]]], [1, [[false, .5], [a3, .5], [f4, .5], [e4, .5], [d4, 2]]], [1, [[false, .5], [d3, .5], [d4, 3]]], [1, [[false, 4]]], [13, [[false, .5], [g4, 1], [g4, 1], [g4, 1], [g4, .5]]], [1, [[false, 2], [c3, 2]]], [2, [[false, 4]]], ] }, rightHand: { one: [ //lows [6, [[false, 8]]], [1, [[a5, .5], [b5, .5], [cs6, .5], [cs6, 1], [a5, 1], [cs6, 1.5], [a5, .5], [cs6, 1], [a5, 1.5]]], [1, [[fs5, .5], [gs5, .5], [a5, .5], [a5, 1], [fs5, 1], [a5, 4.5]]], [1, [[fs5, .5], [gs5, .5], [a5, .5], [a5, 1], [fs5, 1], [d5, 1.5], [e5, .5], [fs5, 1], [d5, 1.5]]], [1, [[cs5, 6], [false, 2]]], [1, [[a4, 2], [gs4, 2], [fs4, 2], [e4, 2]]], [1, [[d5, 2], [cs5, 2], [b4, 2], [a4, 2]]], [1, [[b4, 2], [a4, 2], [gs4, 4]]], [1, [[a4, 2], [gs4, 2], [fs4, 2], [e4, 2]]], [1, [[a4, .5], [b4, .5], [cs5, .5], [cs5, 1], [a4, 1], [cs5, 1.5], [a4, .5], [cs5, 1], [a4, 1.5]]], [1, [[fs4, .5], [gs4, .5], [a4, .5], [a4, 1], [fs4, 1], [a4, 4.5]]], [1, [[fs4, .5], [gs4, .5], [a4, .5], [a4, 1], [fs4, 1], [d4, 1.5], [e4, .5], [fs4, 1], [d4, 1.5]]], [1, [[a4, 4], [false, .5], [b5, .5], [e6, .5], [b6, .5], [false, .5], [e5, .5], [b5, .5], [e6, .5]]], [1, [[a5, 2], [false, 1.5], [e5, 2.5], [false, 2]]], [1, [[c5, 2], [b4, 2], [a4, 2], [g4, 2]]], [1, [[false, 5], [f6, .5], [e6, .5], [d6, .5], [a5, .5], [f5, .5], [e5, .5]]], [1, [[d5, 2], [c5, 2], [b4, 4]]], [1, [[c5, 2], [b4, 2], [a4, 2], [g4, 2]]], [1, [[c5, .5], [d5, .5], [e5, .5], [e5, 1], [c5, 1], [e5, 1.5], [c5, .5], [e5, 1], [c5, 1.5]]], [1, [[a4, .5], [b4, .5], [c5, .5], [c5, 1], [a4, 1], [c5, 4.5]]], [1, [[a4, .5], [b4, .5], [c5, .5], [c5, 1], [a4, 1], [f4, 1.5], [g4, .5], [a4, 1], [f4, 1.5]]], [1, [[c4, .5], [g4, 1], [g4, 1], [g4, 1], [g4, .5]]], [1, [[false, 4], [c4, 4]]], [1, [[false, 4], [d4, 1.5], [e4, 2.5]]], [1, [[false, 4], [c4, 4]]], [1, [[a4, 2], [b4, 2], [g4, 4]]], [1, [[a4, 2], [b4, 2], [c5, 4]]], [1, [[f5, 2], [g5, 2], [c5, 4]]], [1, [[false, 4], [c4, 2], [c4, 2]]], [1, [[false, 8]]] ], two: [ //highs [2, [[false, 8]]], [1, [[cs6, .5], [d6, .5], [e6, .5], [e6, 1], [cs6,1], [e6, 1], [a6, 1], [e6, 1], [cs6, 1.5]]], [1, [[d6, .5], [e6, .5], [fs6, .5], [fs6, 1], [d6,1], [fs6, 4.5]]], [1, [[d6, .5], [e6, .5], [fs6, .5], [fs6, 1], [d6,1], [fs6, 1], [b6, 1], [gs6, 1], [e6, 1.5]]], [1, [[cs6, .5], [d6, .5], [e6, .5], [e6, 1], [a6,1], [e6, 4.5]]], [1, [[fs6, .5], [gs6, .5], [a6, .5], [a6, 1], [fs6, 1], [a6, 1.5], [fs6, .5], [a6, 1], [fs6, 1.5]]], [1, [[d6, .5], [e6, .5], [fs6, .5], [fs6, 1], [d6, 1], [fs6, 4.5]]], [1, [[d6, .5], [e6, .5], [fs6, .5], [fs6, 1], [d6, 1], [b5, 1.5], [cs6, .5], [d6, 1], [b5, 1.5]]], [1, [[a5, 6], [false, .5], [e4, .5], [a4, .5], [b4, .5]]], [1, [[cs5, .5], [d5, .5], [e5, .5], [e5, 1], [cs5, 1], [e5, 1], [a5, 1], [e5, 1], [cs5, 1.5]]], [1, [[d5, .5], [e5, .5], [fs5, .5], [fs5, 1], [d5, 1], [fs5, 4.5]]], [1, [[d5, .5], [e5, .5], [fs5, .5], [fs5, 1], [d5, 1], [fs5, 1], [b5, 1], [gs5, 1], [e5, 1.5]]], [1, [[cs5, .5], [d5, .5], [e5, .5], [e5, 1], [a5, 1], [e5, 4.5]]], [1, [[fs5, .5], [gs5, .5], [a5, .5], [a5, 1], [fs5, 1], [a5, 1.5], [fs5, .5], [a5, 1], [fs5, 1.5]]], [1, [[d5, .5], [e5, .5], [fs5, .5], [fs5, 1], [d5, 1], [fs5, 4.5]]], [1, [[d5, .5], [e5, .5], [fs5, .5], [fs5, 1], [d5, 1], [b4, 1.5], [cs5, .5], [d5, 1], [b4, 1.5]]], [1, [[cs5, .5], [d5, .5], [e5, .5], [e5, 1], [a5, 1], [e5, 2.5], [false, 2]]], [1, [[cs5, .5], [d5, .5], [e5, .5], [e5, 1], [a5, 1], [cs5, 2.5], [a4, .5], [b4, .5], [cs5, .5], [d5, .5]]], [1, [[e5, .5], [f5, .5], [g5, .5], [g5, 1], [e5, 1], [g5, 1.5], [c6, .5], [g5, 1], [e5, 1.5]]], [1, [[f5, .5], [g5, .5], [a5, .5], [a5, 1], [f5, 1], [a5, 4.5]]], [1, [[f5, .5], [g5, .5], [a5, .5], [a5, 1], [f5, 1], [a5, 1.5], [d6, .5], [b5, 1], [g5, 1.5]]], [1, [[e5, .5], [f5, .5], [g5, .5], [g5, 1], [c6, 1], [g5, 4.5]]], [1, [[a5, .5], [b5, .5], [c6, .5], [c6, 1], [a5, 1], [c6, 1.5], [a5, .5], [c6, 1], [a5, 1.5]]], [1, [[f5, .5], [g5, .5], [a5, .5], [a5, 1], [f5, 1], [a5, 4.5]]], [1, [[f5, .5], [g5, .5], [a5, .5], [a5, 1], [f5, 1], [d5, 1.5], [e5, .5], [f5, 1], [d5, 1.5]]], [1, [[c5, 4]]], [1, [[false, .5], [d7, .5], [g6, .5], [d6, 1], [g6, .5], [d6, .5], [g5, .5], [c6, 4]]], [1, [[false, .5], [d7, .5], [g6, .5], [d6, 1], [g6, .5], [d6, .5], [g5, .5], [d6, 1.5], [e6, 2.5]]], [1, [[false, .5], [d7, .5], [g6, .5], [d6, 1], [g6, .5], [d6, .5], [g5, .5], [c6, 4]]], [2, [[f6, 2], [g6, 2], [e6, 4]]], [1, [[c7, 2], [b6, 2], [false, .1], [c7, 3.9]]], [1, [[false, .5], [d7, .5], [g6, .5], [d6, 1], [g6, .5], [d6, .5], [g5, .5], [c6, 2], [false, 2]]], [1, [[false, 8]]], ], three: [ // that one Arpeggiated chord [31, [[false, 8]]], [1, [[false, 4]]], [1, [[false, 4], [false, .05], [g6, 3.95]]], [2, [[false, 8]]], ], } } Object.keys(hands).forEach(hand => Object.keys(hands[hand]).forEach(finger => { loop( () => { hands[hand][finger].forEach(noteSet => { for(let i = 0; i < noteSet[0]; i++) { noteSet[1].forEach(note => play(...note)); } }); }, { amp: .5, name: hand+'_'+finger }); }) ); const play = (note, length) => { if(note !== false) sine.play(note, {attack: 0, release: length, pan: (Math.random() * 1.6) - .8, env: adsr2}); sleep(length); }