[Microbit-Python] Musical silliness...

Damien George damien.p.george at gmail.com
Thu Oct 15 15:46:16 CEST 2015


>> 3. If we are giving up polyphony (which is fine) why not have a method
>> set_pin which sets the output pin to use for all operations (including
>> stop)?
>>
>
> I guess because there is a chance someone *could* still do polyphony if
> they were more of a maker/hacker type rather than a kid and it'd be
> cool. We'd be closing down that option if we didn't allow people to
> specify the pin.

We could support polyphony by creating multiple "music" instances, eg:

music0 = microbit.Music(pin=pin0)
music1 = microbit.Music(pin=pin1)

The current music "module" is then simply a precreated Music object
that uses pin0 by default.  We anyway store tempo as state in the
music instance, so why not pin?

> I'd like to add that such conversations are one of the reasons I love
> software development. It feels good to think about and implement things
> like this.

I love to code.  But desiging APIs is really hard, so it is great to
have a big discussion and then know you are implementing a solid and
thought-out idea :)


More information about the Microbit mailing list