Skip to content

Commit

Permalink
Allow p to indicate a rest per RTTTL spec (#4)
Browse files Browse the repository at this point in the history
  • Loading branch information
alex-kulcsar authored Apr 30, 2022
1 parent 45d7dd8 commit 161db28
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion pxt.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"device": "*"
},
"targetVersions": {
"target": "1.2.9",
"target": "1.8.22",
"targetId": "arcade"
},
"supportedTargets": [
Expand Down
2 changes: 1 addition & 1 deletion test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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...")

0 comments on commit 161db28

Please sign in to comment.