dhylands / upy-rtttl

Python Parser for Ring Tone Text Transfer Language (RTTTL)
MIT License
37 stars 10 forks source link

Micro:bit music format #1

Open mpapec opened 7 years ago

mpapec commented 7 years ago

Hello,

when I run pyb_test.py I've got values like

(587.4, 214.28571428571428) (622.2, 214.28571428571428) (659.2, 214.28571428571428) ...

Is there a way to output in microbit format eg. 'g4:1', 'c5', 'e', 'g:2', 'e:1', 'g:3'?

dhylands commented 7 years ago

Do you have a pointer to the documentation of the format you're looking for?

mpapec commented 7 years ago

Only this,

http://coderdojoscotland.com/wp-content/uploads/2016/04/Musical-Microbit.pdf (page 5)

scruss commented 4 years ago

micro:bit's music format is MML/SMX, aka Music Macro Language used in GWBASIC/QBasic/MSX BASIC/Linux speaker tunes. The standard parser library, MMLlib, is probably a little large for MicroPython.

I don't know how much of the rather baroque MML standard is supported by the micro:bit. RTTTL assumes a fixed tempo, MML can change tempo at any time.

mpapec commented 4 years ago

I was looking for a way to translate RTTTL tune format into MML one; no need to do it on the fly using board itself. This should be possible as MML supports more features?

Support can be tried out without owning microbit ("edit code" to change tones) https://makecode.microbit.org/_F4CdWFVsohL8

davehylands commented 4 years ago

I'm not familiar with MML, so I'm not sure. You can run this library on your host PC. It doesn't have code that is specific to the microcontroller.

The pc_test.py shows a simple example of using the library from a PC: https://github.com/dhylands/upy-rtttl/blob/master/pc_test.py