We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent cd0363c commit 15ce977Copy full SHA for 15ce977
fieldeditors.ts
@@ -242,6 +242,16 @@ namespace microcode {
242
return result
243
}
244
245
+ function notesToMelody(txt: string) {
246
+ const seq = txt.split(" ")
247
+ let res = ""
248
+ seq.forEach((note, index) => {
249
+ if (note == "-") res += "."
250
+ else res += noteNames.indexOf(note).toString
251
+ })
252
+ return { notes: res, tempo: 120 }
253
+ }
254
+
255
export const MELODY_LENGTH = 4
256
export const NUM_NOTES = 5
257
@@ -302,8 +312,7 @@ namespace microcode {
302
312
return melodyToNotes(melody)
303
313
304
314
fromText(txt: string): Melody {
305
- // TODO
306
- return undefined
315
+ return notesToMelody(txt)
307
316
308
317
309
318
0 commit comments