Scratch 3 the gift that keeps on giving; including the new extensions are Text to Speech and Translate; Text to speech - does as the name suggests, turns typed in phrases into speech via Amazon Web Services. Translate using Google (and I assume Google Translate?) to translate text between different languages.
As an experiment, I waned to play with clapping my hands, have Scratch the Cat ask me to enter a phrase and then convert that into French, German and Spanish with different voices. The resulting code is shown below.
It is all started by a loud noise like a hand clap. The two extensions have been added to the blocks and are ready to go. The voice is initially set to Alto and the text-speech block has had the phrase "Please enter a phrase" typed in and says this. The ask block has the same question permanently set and the answer produced gets feed into the translations.
The remaining blocks do essentially the same thing
- change the voice;
- take the phrase typed in (via answer) and convert to the language of choice;
- wait a second.
It is great fun, I am not sure all the languages work but what is there is cool to play with. In an ideal world instead of typing the phrase it would be great to just say the phrase...maybe in the future.
The code is available at https://scratch.mit.edu/projects/282312832/.
All opinions in this blog are the Author's and should not in any way be seen as reflecting the views of any organisation the Author has any association with. Twitter @scottturneruon
Robots and getting computers to work with the physical world is fun; this blog looks at my own personal experimenting and building in this area.
Friday, 25 January 2019
Thursday, 3 January 2019
Scratch and web-cams in Scratch 3
Scratch 3 was launched on 2nd January 2019, so I wanted to know would Webcams still work with Scratch 3 as it did with Scratch 2. For example, in a previous post Scratch, webcams, cats and explosions the cat (Scratch) moved across the screen and a button burst when the object moved in the camera onto it.
Can the same thing be done in Scratch 3? The short answer is yes, but it is done slightly differently.
The first change the video capture is not there in the blocks automatically; but is an extension that needs to be added. First, you need to add the extension blocks for video sensing. Go to the little icon at the bottom left of the screen (as shown below) this takes you to the extensions menu.
Next, find the Video Sensing option and selected. The webcam, if enabled, with start automatically.
A video sensing set of blocks is now in the list of block options.
The rest is very similar to doing this in Scratch 2.
Moving Scratch: The code below moves the cat backwards and forwards depending on whether the object is moving left to right on the screen, or not.
The bursting bubble is done with the code below. When the object in the camera is on the button; make a popping noise, switch to an image (costume) that of a burst button, wait 1 second and return to the whole button image.
The code is available at https://scratch.mit.edu/projects/276892758/ please feel free to improve it and let me know.
All opinions in this blog are the Author's and should not in any way be seen as reflecting the views of any organisation the Author has any association with. Twitter @scottturneruon
Can the same thing be done in Scratch 3? The short answer is yes, but it is done slightly differently.
The first change the video capture is not there in the blocks automatically; but is an extension that needs to be added. First, you need to add the extension blocks for video sensing. Go to the little icon at the bottom left of the screen (as shown below) this takes you to the extensions menu.
Next, find the Video Sensing option and selected. The webcam, if enabled, with start automatically.
A video sensing set of blocks is now in the list of block options.
The rest is very similar to doing this in Scratch 2.
Moving Scratch: The code below moves the cat backwards and forwards depending on whether the object is moving left to right on the screen, or not.
The code is available at https://scratch.mit.edu/projects/276892758/ please feel free to improve it and let me know.
All opinions in this blog are the Author's and should not in any way be seen as reflecting the views of any organisation the Author has any association with. Twitter @scottturneruon
Monday, 31 December 2018
Top 5 posts in 2018 from the Robots and Physical Computing blog
- This is really part two of a set of post in response to a question from Carl Simmons ( @Activ8Thinking ) concerning building a micro:bit ...
- This post is in response to a question from Carl Simmons ( @Activ8Thinking ) about has anyone built a microbit simple neuron. Quick Overv...
- I was asked recently if the USB robot arm could be programmed - I knew the answer was yes. The Arm came from the CBiS Education Robot Arm ...
- You can control servos (small ones) from a Micro:Bit directly. Following a link from the David Whale (Twitter @ whaleygeek ) , thank you, t...
- In previous posts ( post 1 , post 2 ) I have raved over the brilliant combination of Mozilla's AFrame and Jerome Etienne's fantastic...
All opinions in this blog are the Author's and should not in any way be seen as reflecting the views of any organisation the Author has any association with. Twitter @scottturneruon
Sunday, 23 December 2018
How to videos... Web based Augmented Reality
Video 1: How to produce a simple web-based augmented reality application.
Video 2: Using AFrame and AR.js to create AR - this time adding an image and rotation to an AR object.
Related Links
- Basic guide and starting point https://aframe.io/blog/arjs/#move-the-camera-or-the-marker
- Example: White block (needs the Hiro marker) https://gregarious-fibre.glitch.me/
- Example: An image is added to block (needs the Hiro marker) https://glitch.com/~dandy-custard
- Further guidance on setting up AR through AR.js https://robotsandphysicalcomputing.blogspot.com/2018/07/webvr-3-playtime-augmented-reality.html
- Further guidance adding objects into AR https://robotsandphysicalcomputing.blogspot.com/2018/07/webvr-4-playtime-putting-objects-into.html
- Guide on adding video into AR https://robotsandphysicalcomputing.blogspot.com/2018/10/webvr5-playtime-augmented-reality-to.html
All opinions in this blog are the Author's and should not in any way be seen as reflecting the views of any organisation the Author has any association with. Twitter @scottturneruon
Saturday, 1 December 2018
Scratch, webcams, cats and explosions
Still enjoying playing with Scratch and webcam. in this post, initially improving on the example shown in a previous post Webcam and Scratch; enhancing the movement of Scratch the Cat by adding the interim step and facing in the direction of the 'moving finger' (see the code below).
Please go to the code at https://scratch.mit.edu/projects/263334488/ to try it yourself.
Going to add one more feature to experiment with getting objects to react to the motion. In this case to explode a button or change a button to a small ball by moving the finger onto the button. The motion on the sprite is used to do this.
Please try the code yourself at https://scratch.mit.edu/projects/266837380/
All opinions in this blog are the Author's and should not in any way be seen as reflecting the views of any organisation the Author has any association with. Twitter @scottturneruon
Please go to the code at https://scratch.mit.edu/projects/263334488/ to try it yourself.
Going to add one more feature to experiment with getting objects to react to the motion. In this case to explode a button or change a button to a small ball by moving the finger onto the button. The motion on the sprite is used to do this.
Please try the code yourself at https://scratch.mit.edu/projects/266837380/
All opinions in this blog are the Author's and should not in any way be seen as reflecting the views of any organisation the Author has any association with. Twitter @scottturneruon
Sunday, 25 November 2018
Getting Adafruit Circuit Playground Express to respond to music
In a previous post, Adafruit Circuit Playground reacting to music (updated with simulator) using vibrations to change the RGB of pixels on the Circuit Playground Express was played with (it is too much fun to not). Here I am going to go even simpler, using the sound level directly, again using MakeCode.
The circuit playground includes a microphone so sound levels can be used directly, by using them to vary the RGB inputs and brightness of the pixel (see the code above). You can try the idea out on the simulator below; the circle bottom left can be used to simulate varying the sound level.
Please feel free to alter the code and share; the code is available at https://makecode.com/_8UPY8oD54bmE
All opinions in this blog are the Author's and should not in any way be seen as reflecting the views of any organisation the Author has any association with. Twitter @scottturneruon
The circuit playground includes a microphone so sound levels can be used directly, by using them to vary the RGB inputs and brightness of the pixel (see the code above). You can try the idea out on the simulator below; the circle bottom left can be used to simulate varying the sound level.
Please feel free to alter the code and share; the code is available at https://makecode.com/_8UPY8oD54bmE
All opinions in this blog are the Author's and should not in any way be seen as reflecting the views of any organisation the Author has any association with. Twitter @scottturneruon
Monday, 19 November 2018
Webcam and Scratch
I have to admit I do enjoy playing with Scratch. I heard you can connect a webcam to Scratch and though there might be quite a lot of set-up. I was wrong, it is was very easy just one block really. So in this very short post, I share my (very simple) code. Getting Scratch the Cat to follow my finger left or right.
I am intrigued to see what else can be done.
Code is at https://scratch.mit.edu/projects/263334488/
All opinions in this blog are the Author's and should not in any way be seen as reflecting the views of any organisation the Author has any association with. Twitter @scottturneruon
I am intrigued to see what else can be done.
Code is at https://scratch.mit.edu/projects/263334488/
All opinions in this blog are the Author's and should not in any way be seen as reflecting the views of any organisation the Author has any association with. Twitter @scottturneruon
Subscribe to:
Posts (Atom)
Who wants to produce AI produced cartoon strips
Question: How easy is it produce a comic/cartoon using genetative AI? Let's start with using ChatGPT4o to produce cartoons. The idea wa...