Merge pull request #56 from Microsoft/note
This commit is contained in:
		
							
								
								
									
										18
									
								
								libs/music/piano.ts
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										18
									
								
								libs/music/piano.ts
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,18 @@ | |||||||
|  | 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 | ||||||
|  |     //% note.fieldOptions.minNote=52 note.fieldOptions.maxNote=75 | ||||||
|  |     //% useEnumVal=1 | ||||||
|  |     //% weight=10 blockGap=8 | ||||||
|  |     export function noteFrequency(name: Note): number { | ||||||
|  |         //TODO fill in actual min/max note values | ||||||
|  |         return name; | ||||||
|  |     } | ||||||
|  | } | ||||||
| @@ -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" | ||||||
|   | |||||||
| @@ -39,8 +39,8 @@ | |||||||
|     "semantic-ui-less": "^2.2.4" |     "semantic-ui-less": "^2.2.4" | ||||||
|   }, |   }, | ||||||
|   "dependencies": { |   "dependencies": { | ||||||
|     "pxt-common-packages": "0.14.3", |     "pxt-common-packages": "0.14.5", | ||||||
|     "pxt-core": "2.3.28" |     "pxt-core": "2.3.29" | ||||||
|   }, |   }, | ||||||
|   "scripts": { |   "scripts": { | ||||||
|     "test": "node node_modules/pxt-core/built/pxt.js travis" |     "test": "node node_modules/pxt-core/built/pxt.js travis" | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user