[Microbit-Python] A sound related long shot...

Nicholas H.Tollervey ntoll at ntoll.org
Fri Oct 16 17:57:15 CEST 2015


Damien,

That's brilliant. :-)

See comments in-line below.

On 16/10/15 14:48, Damien George wrote:
> I have managed to get proper synthesised audio out of the microbit,
> using a hand-written PWM loop.  As a proof of principle, it can play a
> short recorded sample.
> 
> Attached is the firmware.  I won't tell you what the sample is, so see
> if you can find out!  Here are instructions:
> 
> 1. download firmware.hex to the microbit
> 2. attach a speaker to pin0 and pin1 (don't use ground)
> 3. load up the serial terminal
> 4. execute: synth_run(10, 31, 3)
> 5. listen in awe!
> 

Awestruck. I especially like that I can make it work with just a couple
of crocodile clips and a cheap speaker.

> You can adjust the numbers passed to synth_run to muck about with the sample.
> 

I'll try that when I get home (I tested this by surreptitiously sneaking
off to the staff canteen with my laptop). ;-)

> With this we can basically play any audio, from a mod tracker to a
> speech synth.  The only caveat is that it can't run in the background.
> The loop needs full control of the CPU to get the audio to play
> properly.
> 

IMHO that's an acceptable trade-off given the awesomeness of the end result.

> To answer Nicholas' questions:
> 
> 1. Could this be done? Yes.

AMEN!

> 2. Would we want to do it? It would be cool if it (speech synth, or a
> mod tracker, or ...) was implemented.

I agree. In terms of inspiration, fun and ZOMG factors this is quite
high up there.

> 3. What would need to happen? We need to find someone with the time to
> implement it!  It's a fair bit of work (but there are no barriers
> except time).
> 

Understood... this is why I'm pushing the BBC so hard to allow us to
work in the open. There is bound to be someone, somewhere who could help.

> The SAM software would be ideal, if only it were properly licensed.
> Otherwise there's a fair bit of work to record all the 49 phonemes,
> etc.
> 

Surely, there are unencumbered digital assets for the 49 phonemes. Could
we not re-use stuff from free software projects such as rsynth, mbrola,
KTTS or festival?

Alternatively (and rather foolishly) how hard can it be to record all 49
phonemes..?

:-)

> Maybe we can just provide some prerecorded samples (eg "exterminate")
> and provide functions to adjust the pitch, echo, etc, and combine
> sounds, and then play them?
> 

The problem is that it limits what you can get the device to say. :-/

Mind you... it's still pretty amazing.

N.

> D.
> 
> 
> 
> 
> On Fri, Oct 16, 2015 at 1:37 PM, Larry Hastings <larry at hastings.org> wrote:
>>
>>
>> On 10/16/2015 05:23 AM, Nicholas H.Tollervey wrote:
>>
>> Hi Folks,
>>
>> So I was thinking about the amazing example Larry posted yesterday of
>> the 20yo calculator turned into a multi-part sequencer with effects etc...
>>
>> Could we do something just as amazing... would we even want to try..?
>>
>> Then I remembered - as a child of the 1980s I had an original BBC B at
>> home and one of the most amazing feats Superior Software pulled off was
>> a 7.5k program called, simply, "Speech!". To give you an idea of what it
>> was like I found this on YouTube:
>>
>> https://www.youtube.com/watch?v=t8wyUsaDAyI
>>
>>
>> The equivalent for computers manufactured outside Britain was "Software
>> Automatic Mouth", or "SAM", available for the Apple ][, Atari 400/800, and
>> Commodore 64.
>>
>> Some enterprising hacker has taken the C=64 version, compiled the assembler
>> into messy C, cleaned it up (some), and put it up on Github:
>>
>> https://github.com/s-macke/SAM
>>
>>
>> He then used Emscript to translate that into Javascript, and behold: web
>> page demo.
>>
>> http://simulationcorner.net/index.php?page=sam
>>
>>
>> (Aside: cripes, modern computers are fast.  Just imagine how awful this code
>> is, and what a Rube Goldberg machine its runtime must be like.  Yet it runs
>> in the tiniest fraction of a second.)
>>
>> So, thoughts..? Is this even possible..? I imagine a very simple API
>> such as this:
>>
>> import microbit
>> microbit.say("Hello, World")
>> microbit.say("Hello, World", pin=microbit.pin1)  # Lke music API
>>
>>
>> Possible, yes.  But I don't know anything about voice synthesis, so I could
>> hardly write one myself.  And even if SAM is "abandonware", legally somebody
>> still owns the copyright, so I wouldn't ship that specific implementation.
>>
>>
>> /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


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 473 bytes
Desc: OpenPGP digital signature
URL: <https://mail.python.org/mailman/private/microbit/attachments/20151016/e78268c2/attachment.sig>


More information about the Microbit mailing list