[Microbit-Python] Musical silliness...

Damien George damien.p.george at gmail.com
Thu Oct 15 14:20:08 CEST 2015


I agree to renaming "tune" to "play" and having the pin parameter
named "pin" and second position and optional (with default pin0).

But, at the risk of openning a can of worms:

1. Why not play_note, play_pitch, play_tune?  The original reason for
calling tune tune is that "play" was implicit, like it is implicit in
note and pitch.

2. Why not merge note and tune and let "play" take either a string (an
individual note) or a list of strings (a tune)?

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)?


On Thu, Oct 15, 2015 at 12:39 PM, Nicholas H.Tollervey <ntoll at ntoll.org> wrote:
> On 15/10/15 12:22, Larry Hastings wrote:
>>
>>
>> On 10/15/2015 12:54 AM, Nicholas H.Tollervey wrote:
>>> * Specification of the pin is done via a named parameter called "pin"
>>> that has the default value of microbit.pin0.
>>> * music.tune should be renamed to music.play
>>>
>>> So we get code like this:
>>>
>>>>>> from microbit import music
>>>>>> music.play(music.NYAN)
>>>>>> import microbit
>>>>>> music.note('c4:4', pin=microbit.pin1)
>>>
>>
>> LGTM.  I appreciate your open-mindedness!  I was worried I was
>> resurrecting an old talked-to-death topic that only you still had the
>> stamina to argue about.  ;-)
>>
>
> My default setting is, "I'm probably wrong" and I *enjoy* constructive
> critique. I'm not precious about my opinions and would rather people
> knock holes in them.
>
> My feeling is that an API needs to earn its design through some sort of
> Socratic / devil's advocate like process of poking holes in it. Anything
> that makes an API simpler, easier and clearer is a good thing - even if
> it takes longer or requires people to change position.
>
>> One tiny bit of bikeshedding.  "output=" instead of "pin=" for the named
>> parameter?  Yes?  No?  Just a thought, I'm not wedded to it.
>>
>
> I agree with Michael and Matthew. It's unambiguous and kid friendly.
>
> N.
>
>> Cheers,
>>
>>
>> //arry/
>>
>>
>> _______________________________________________
>> Microbit mailing list
>> Microbit at python.org
>> https://mail.python.org/mailman/listinfo/microbit
>>
>
>
>
> _______________________________________________
> Microbit mailing list
> Microbit at python.org
> https://mail.python.org/mailman/listinfo/microbit
>


More information about the Microbit mailing list