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"
|
2017-11-30 21:44:22 +01:00
|
|
|
//% note.fieldEditor="note" note.defl="1046"
|
2017-11-21 20:35:53 +01:00
|
|
|
//% note.fieldOptions.editorColour="#FF1493" note.fieldOptions.decompileLiterals=true
|
2017-11-29 01:04:25 +01:00
|
|
|
//% note.fieldOptions.minNote=52 note.fieldOptions.maxNote=75
|
2017-11-21 20:35:53 +01:00
|
|
|
//% useEnumVal=1
|
|
|
|
//% weight=10 blockGap=8
|
|
|
|
export function noteFrequency(name: Note): number {
|
2017-11-28 02:21:32 +01:00
|
|
|
//TODO fill in actual min/max note values
|
2017-11-21 20:35:53 +01:00
|
|
|
return name;
|
|
|
|
}
|
|
|
|
}
|