Snapinator development (Snap! programmers wanted)

Interesting talk, and the demo was super cool! Thanks @jens.

Just watched it :slight_smile:

Oh is it online now? Same YouTube URL as the streaming?

Yep, YouTube streams do that automatically.

1 Like

For some reason, a "shown?" block was added into an "if <> then" block when I used the Snapinator. It even added an "and" block to fit it in there. Why?

Scratch's touching block only returns true if the sprite is visible. Snap!'s doesn't care.

The shown? is there to replicate Scratch's behavior.

oh ok

Snap already has a TTS library.

People have mentioned that several times. It doesn't support all the voices that Scratch does.

it depends on the browser, well, in snap.

here is my solution:

Unfortunately Scratch handles types differently when stringifying a list than in every other context. So while that's nice and intuitive, that won't always behave the same as Scratch.

Usually, Scratch and Snap! consider both the JS number 0 and the JS string "0" to be equivalent. However, when stringifying a list, 0 and "0" are treated differently. Unlike Scratch, Snap! consistently treats the two as equal numbers, so there's no way to detect the difference between them without the JS function block.

Just ignore JS. Assume that any one digit string is not a number. That is the only place I have used stringify list used in scratch.

Yeah, that's what I'm leaning toward doing, at least as the default behavior.

I made a pull request on GitHub for support of the Scratch 3.0 list index of block. I was wondering if you at least noticed it?

Oh, yes, I saw it. It's nearing the end of the semester, so I'm currently drowning in schoolwork (more so than usual). I'll review it and start to incorporate the blocks from this thread when I have more time in a week or two. :slight_smile:

I am working on some of the text2speech blocks using google cloud, google text to speech and google translate.

var msg = new SpeechSynthesisUtterance();
msg.volume = 1;
msg.rate = 1;
msg.pitch = 2;
msg.text = "Hello";
msg.lang = 'english';

What expression gives "0" in Scratch?
I've checked this.
The first letter of "0XXX" should be "0", for sure, but see the result ...
It seems that the list containing only digits, even "0", in Scratch, is joined as letters.
So this
Untitled script pic (39)
can be used to choose between "join" and "join words" in Snap!

String operations and generic round inputs give the JS string "0"
Screenshot from 2020-12-04 18-43-36

Math operations give the JS number 0
Screenshot from 2020-12-04 18-43-54

They look and behave identically except for the list behavior.

@elliott47732 and @ego-lay_atman-bay made a nice version of Scratch's translate block.

So now the main missing features now are Scratch-style text-to-speech and the instruments.