Discuss Scratch

spyrofan
Scratcher
74 posts

Kurt 2.0 Discussion Thread

i can't get pip to install the things necessary for my computer
CVCoderDojo
Scratcher
6 posts

Kurt 2.0 Discussion Thread

When I go through all of this and then attempt to use Kurt I get the message

from construct.text import Literal
ImportError: No module named text

Is this a recent change to construct and should I attempt to load an older version?


Never mind. I seem to have worked through the issues. Can't delete this post?

Last edited by CVCoderDojo (April 24, 2015 15:10:41)

blob8108
Scratcher
1000+ posts

Kurt 2.0 Discussion Thread

CVCoderDojo wrote:

Can't delete this post?
Sadly not—the forums don't allow that.

I'm glad you fixed your problem, though!

tosh · slowly becoming a grown-up adult and very confused about it
mobluse
Scratcher
100+ posts

Kurt 2.0 Discussion Thread

It says on Kurt GitHub-page:
“It also includes a parser for converting plain text into Scratch blocks.”
How does one use this? Is the source code for http://kurt.herokuapp.com/parser.sb available?
Can one go in the other direction: converting sb- or sb2-files into text that is parseable?
I think this would be useful for writing Scratch-code faster. Perhaps there is another solution with e.g. an easy to use JSON-editor.

I installed Kurt and Skip today in Raspbian (most upgraded).

blob8108
Scratcher
1000+ posts

Kurt 2.0 Discussion Thread

mobluse wrote:

“It also includes a parser for converting plain text into Scratch blocks.”
How does one use this?
Call .parse() on a Scriptable.
Can one go in the other direction: converting sb- or sb2-files into text that is parseable?
Yup! Call .stringify() on a Script.

Be warned that the parser is experimental and may not work very well. Long-term, I may be working on a secret project which will supersede this feature of Kurt's…

tosh · slowly becoming a grown-up adult and very confused about it
SimpleScratch
Scratcher
500+ posts

Kurt 2.0 Discussion Thread

I've finally got round to trying this out to parse Scratch 1.4 files and its great

I've just done a quick prog
import kurt as kurt
file = "transtest"
filename = "c:\\dropbox\\Private\\ScratchCrumble\\Scratch Projects\\" + file +".sb"
p = kurt.Project.load(filename)

codeInput = ""
for scriptable in p.sprites + :
for script in scriptable.scripts:
#print script
codeInput += str(script)

which gives me a human readable string that I'm then attempting to parse further

Are there some further Kurt calls that I could use to give me something closer to plain text to save me re-inventing the wheel e.g
OnGreenFlag
doForever(
broadcast something
wait atime)

regards
Simon

Last edited by SimpleScratch (June 22, 2015 13:46:03)

blob8108
Scratcher
1000+ posts

Kurt 2.0 Discussion Thread

SimpleScratch wrote:

Are there some further Kurt calls that I could use to give me something closer to plain text
Try script.stringify()

EDIT: see docs

Last edited by blob8108 (June 22, 2015 23:44:20)


tosh · slowly becoming a grown-up adult and very confused about it
SimpleScratch
Scratcher
500+ posts

Kurt 2.0 Discussion Thread

Ta :-)

And one little request please ….

Any chance of recognising BYOB files .ypr as valid filetypes?

Obviously it would be a big bonus if Kurt could parse them correctly but as a starter it would be great to see if it could at least convert them from binary to an easier to parse format

Simon
blob8108
Scratcher
1000+ posts

Kurt 2.0 Discussion Thread

SimpleScratch wrote:

Any chance of recognising BYOB files .ypr as valid filetypes?
That's a big feature! I asked Jens about this in Barcelona, and it sounds like the old BYOB format is even messier and more horrible than the Scratch 1.4 one :p

Like, it's probably feasible, but it would take a long time and I'm unlikely to work on it anytime soon…

tosh · slowly becoming a grown-up adult and very confused about it
SimpleScratch
Scratcher
500+ posts

Kurt 2.0 Discussion Thread

Fair enough

If I get some time, I'll have a look at it myself

Simon
Amaru2
Scratcher
100+ posts

Kurt 2.0 Discussion Thread

I can't donwload Kurt! Help!

I can help you but DON'T UNINSTALL ME!!!!!!!!!!!!!!!!!!!!!!
ChocolatePi
Scratcher
1000+ posts

Kurt 2.0 Discussion Thread

Amaru2 wrote:

I can't donwload Kurt! Help!
You don't have to download it. Just run ‘pip install kurt’ and start writing Python.
meowflash
Scratcher
500+ posts

Kurt 2.0 Discussion Thread

Hey, Blob, I wonder if there will be a version of Kurt that supports Python 3.

More Stuff|My Bandcamp
My DeviantArt|Intro Voting For December 2015 August 10th 2016
Check out my Github, too!

Kumquats, this signature is inedible and poisonus.
Also try the code below in IBNIZ.
sxsaxAr+waxBr-*
Ethan_1
Scratcher
100+ posts

Kurt 2.0 Discussion Thread

@meowflash I have a version that kind of works with Python 3, but is untested. There is no official port (yet).
meowflash
Scratcher
500+ posts

Kurt 2.0 Discussion Thread

Ethan_1 wrote:

@meowflash I have a version that kind of works with Python 3, but is untested. There is no official port (yet).
Okay.

More Stuff|My Bandcamp
My DeviantArt|Intro Voting For December 2015 August 10th 2016
Check out my Github, too!

Kumquats, this signature is inedible and poisonus.
Also try the code below in IBNIZ.
sxsaxAr+waxBr-*
kittyhacker101
Scratcher
100+ posts

Kurt 2.0 Discussion Thread

How do you add a costume to an existing sprite in kurt? I'm a bit confused, and the documentation doesn't really tell you much.

A Gamer / Computer Programmer with 6 cats and a server room.

● Website : https://kittyhacker101.tk/
blob8108
Scratcher
1000+ posts

Kurt 2.0 Discussion Thread

kittyhacker101 wrote:

How do you add a costume to an existing sprite in kurt?
Sprite.costumes is a Python list, so you can just append it.
You can get a new costume from Costume.load:
foo = Costume.load("fridge.png")
sprite.costumes.append(foo)

tosh · slowly becoming a grown-up adult and very confused about it
__init__
Scratcher
1000+ posts

Kurt 2.0 Discussion Thread

Hey, I'm writing a program to batch import ~200 1-second sounds into Scratch, and when I play them in Scratch, they're slowed down to about 2s?

Why is this happening?

Edit: relevant part of code
scratch_sound = kurt.Sound.load("temp/bit{0}.wav".format(j))

edit2: bitrate is 1411kbps incase that matters

edit3: I tried using 0.25s sounds (same bitrate), and they were slowed down 2x as well.

edit4: I downloaded one of the sounds from the project and the bitrate was 177kbps. I'm going to change the original sound's bitrate to see if that makes a difference

edit5: nope

Last edited by __init__ (Jan. 25, 2017 02:58:41)


thisandagain pls explain
blob8108
Scratcher
1000+ posts

Kurt 2.0 Discussion Thread

__init__ wrote:

Why is this happening?
Probably the wrong sound format! Are they mono? Have you checked what bit depth they are? 16-bit? 24-bit? Not sure what else to suggest… :-)

tosh · slowly becoming a grown-up adult and very confused about it
__init__
Scratcher
1000+ posts

Kurt 2.0 Discussion Thread

blob8108 wrote:

__init__ wrote:

Why is this happening?
Probably the wrong sound format! Are they mono? Have you checked what bit depth they are? 16-bit? 24-bit? Not sure what else to suggest… :-)
They're stereo; I'll change this and see if it works

Edit: changed them to mono, it works, yay

Last edited by __init__ (Jan. 25, 2017 22:52:44)


thisandagain pls explain

Powered by DjangoBB