From 161db28da3d4021fc48b91a1a51023c090ec0ebb Mon Sep 17 00:00:00 2001 From: Alex Kulcsar <38046796+alex-kulcsar@users.noreply.github.com> Date: Sat, 30 Apr 2022 00:56:39 -0400 Subject: [PATCH] Allow p to indicate a rest per RTTTL spec (#4) --- main.ts | 2 +- pxt.json | 2 +- test.ts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/main.ts b/main.ts index 81f9c3d..fd5bd79 100644 --- a/main.ts +++ b/main.ts @@ -38,7 +38,7 @@ namespace music { const d = i == 0 ? defaultd : parseInt(note.substr(0, i)) note = note.slice(i) // note - const thenote = note.substr(0, 1) + const thenote = note.substr(0, 1).toUpperCase() == "P" ? "r" : note.substr(0, 1) note = note.slice(1) // #? const hassharp = note.charCodeAt(0) === sharp; diff --git a/pxt.json b/pxt.json index 5675cec..6f2d666 100644 --- a/pxt.json +++ b/pxt.json @@ -16,7 +16,7 @@ "device": "*" }, "targetVersions": { - "target": "1.2.9", + "target": "1.8.22", "targetId": "arcade" }, "supportedTargets": [ diff --git a/test.ts b/test.ts index 7677292..db0b799 100644 --- a/test.ts +++ b/test.ts @@ -14,7 +14,7 @@ console.log("melody") console.log(melody) control.runInParallel(function() { - music.playMelody(melody, 216) // Need to play at double-speed + music.playMelody(melody, 112) // Need to play at double-speed }) game.splash("play RTTTL tunes", "in your games...")