Compare commits

...

3 Commits

Author SHA1 Message Date
78694e86a2 0.6.24 2016-11-30 16:07:34 -08:00
aeaa3d7bc1 updated localization files 2016-11-30 16:07:04 -08:00
af8ce3fccf allow for double, breve note durations 2016-11-30 16:06:17 -08:00
3 changed files with 17 additions and 7 deletions

View File

@ -9,6 +9,8 @@
"AcceleratorRange.TwoG|block": "2g",
"BaudRate.BaudRate115200|block": "115200",
"BaudRate.BaudRate9600|block": "9600",
"BeatFraction.Breve|block": "4",
"BeatFraction.Double|block": "2",
"BeatFraction.Eighth|block": "1/8",
"BeatFraction.Half|block": "1/2",
"BeatFraction.Quarter|block": "1/4",

View File

@ -119,7 +119,11 @@ enum BeatFraction {
//% block="1/8"
Eighth = 8,
//% block="1/16"
Sixteenth = 16
Sixteenth = 16,
//% block="2"
Double = 32,
//% block="4",
Breve = 64
}
/**
@ -188,11 +192,15 @@ namespace music {
init();
if (fraction == null) fraction = BeatFraction.Whole;
let beat = 60000 / beatsPerMinute;
if (fraction == BeatFraction.Whole) return beat;
else if (fraction == BeatFraction.Half) return beat / 2;
else if (fraction == BeatFraction.Quarter) return beat / 4
else if (fraction == BeatFraction.Eighth) return beat / 8;
else return beat / 16;
switch (fraction) {
case BeatFraction.Half: return beat / 2;
case BeatFraction.Quarter: return beat / 4;
case BeatFraction.Eighth: return beat / 8;
case BeatFraction.Sixteenth: return beat / 16;
case BeatFraction.Double: return beat * 2;
case BeatFraction.Breve: return beat * 4;
default: return beat;
}
}
/**

View File

@ -1,6 +1,6 @@
{
"name": "pxt-microbit",
"version": "0.6.23",
"version": "0.6.24",
"description": "micro:bit target for PXT",
"keywords": [
"JavaScript",