pxt-ev3/libs/music/piano.ts

17 lines
600 B
TypeScript
Raw Normal View History

2017-11-21 20:35:53 +01:00
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
2017-11-22 02:11:11 +01:00
//% note.fieldOptions.minNote=131 note.fieldOptions.maxNote=277
2017-11-21 20:35:53 +01:00
//% useEnumVal=1
//% weight=10 blockGap=8
export function noteFrequency(name: Note): number {
return name;
}
}