Initial work

This commit is contained in:
Caitlin Hennessy 2017-11-21 11:35:53 -08:00
parent 52816e6de7
commit ed1c187514
2 changed files with 17 additions and 0 deletions

16
libs/music/piano.ts Normal file
View File

@ -0,0 +1,16 @@
namespace music {
/**
* Get the frequency of a note.
* @param name the note name, eg: Note.C
*/
//% weight=1 help=music/note-frequency
//% blockId=device_note block="%note"
//% shim=TD_ID color="#FFFFFF" colorSecondary="#FFFFFF"
//% note.fieldEditor="note" note.defl="262"
//% note.fieldOptions.editorColour="#FF1493" note.fieldOptions.decompileLiterals=true
//% useEnumVal=1
//% weight=10 blockGap=8
export function noteFrequency(name: Note): number {
return name;
}
}

View File

@ -8,6 +8,7 @@
"shims.d.ts", "shims.d.ts",
"melodies.ts", "melodies.ts",
"music.ts", "music.ts",
"piano.ts",
"sounds.jres", "sounds.jres",
"sounds.ts", "sounds.ts",
"ns.ts" "ns.ts"