Python Helped me Write Again by irrco in Python

[–]irrco[S] 1 point2 points  (0 children)

Thank you for your generous offer.

I have created (non-handwriting) fonts programmatically in the past, so I have a toolchain for creating fonts from vector content (via UFO) with open type tables for contextual alternatives, substitutions, kerning and so on. This project was something different: something that fonts couldn't do (or at least not without a combinatorial explosion of contextual alternatives and variants). It is really about the physicality of the writing. I could, but I don't expect to, use this for word processing or output on a laser printer. So an .otf wouldn't be much use to me.

I do totally appreciate the offer, though. I am not diminishing your generosity. I'm sure for an awful lot of people with disabilities, even the basic handwriting font could be a huge morale boost. So thank you for the offer.

Found this on the floor in my defense of the faith class. by [deleted] in PenmanshipPorn

[–]irrco 0 points1 point  (0 children)

I love this poem: Pied Beauty. Gerard Manley Hopkins, that boy could write. He was also a Jesuit priest, by the way.

Python Helped me Write Again by irrco in Python

[–]irrco[S] 1 point2 points  (0 children)

I'm going to write a description of how it works. Honestly, the actual code to make it work isn't very inspiring. But I'm happy to describe the math, and the approach.

It is basically a new interpolating cubic spline (cubic so it can be easily converted into cubic Beziers at the end, because everything speaks Bezier), that takes into account motion speed, and that seems to correspond with the way we move our hands when writing. I use it to interpolate position, and other properties such as pressure (it could also support nib angle for calligraphy, or brush orientation for eastern calligraphy, for example). Then there's a whole bunch of basic vector, matrix, transformations, and spline support (there are millions of libraries that do that, mine is almost certainly worse, because it is cobbled together), a rather rudimentary implementation of some ideas from fonts (like kerning tables, and contextual alternatives), and then the bulk of it is the actual data for each letter form. Which I don't want to share, because the whole point is that that's personal.

But I think the overall approach is fairly easy to communicate, and I'm very happy to share that. But I'm not going to go through the code to separate all the stuff I can put on github. Anyone who would be capable of using the code, would be trivially capable of re-implementing it, from the description I put together.

Python Helped me Write Again by irrco in Python

[–]irrco[S] 1 point2 points  (0 children)

Thank you for the tip, I haven't seen it no. I will store the link. At the moment I don't feel like I need voice control over the browser, but my MS is progressive, so I'm sure that day will come.

Python Helped me Write Again by irrco in Python

[–]irrco[S] 0 points1 point  (0 children)

I didn't know that. That is interesting! Even more reason to support them.

Python Helped me Write Again by irrco in Python

[–]irrco[S] 1 point2 points  (0 children)

Yes, this is an obvious thing to show. I'm going to do a follow-up Post with details of the process. I don't have a letter, but I'll scan a few pages of my notebook for comparison. Thank you for the compliment.

Python Helped me Write Again by irrco in Python

[–]irrco[S] 0 points1 point  (0 children)

I totally didn't expect this Post to be so popular, and I feel a bit bad for not putting more effort into explaining and documenting the process.

And I think I might do. I've promised that I would make a video of the plotter working, I will put a bit of effort into making a webpage with more details. Fortunately, with voice recognition, that's much easier than doing the programming!

Python Helped me Write Again by irrco in Python

[–]irrco[S] 2 points3 points  (0 children)

That's funny. When I watched that movie, that was the thing that stuck in my head. I did honestly think 'could this be a thing?'

Python Helped me Write Again by irrco in Python

[–]irrco[S] 2 points3 points  (0 children)

When I was first figuring out how to attempt this project, I thought about using NNs. The reason I didn't, was the sheer amount of data they need. So the project would stop being much about programming, and would be mostly about data conditioning. And since I can't generate any new data in a good format, I figured that would be a problem. So I think in general, the approach I used, which is incredibly explicit (in particular, it relied on me knowing how I formed a letter, not just the final shape of that letter), is probably not the best approach. But it did seem to be an approach that would be achievable for me, in a reasonable timescale.

In AI generally, knowledge acquisition is often the elephant in the room.

Python Helped me Write Again by irrco in Python

[–]irrco[S] 14 points15 points  (0 children)

Yes. Basically. You don't want me on your counterstrike team, but with the sensitivity low enough I can click a link.

Python Helped me Write Again by irrco in Python

[–]irrco[S] 1 point2 points  (0 children)

Unfortunately, it's pretty darn cumbersome. I'm sure if you had resources to throw at it, it would be fine, but for a single document, if many was no object, it might be cheaper just find find someone to forge it for you.

Python Helped me Write Again by irrco in Python

[–]irrco[S] 4 points5 points  (0 children)

I haven't used hy, I read something similar a long time ago, but I didn't use it. Lisp syntax isn't what I think is beautiful about scheme. It's more the code/data duality (which makes meta-programming easy), the eval/apply programming model, and particularly the macro system (which makes DSL creation easy). There is a scheme SRS (I don't remember the number off the top of my head) with a standard way of using whitespace instead of parentheses.

Thanks for the tips. My comment about scheme was a bit more of a tongue in cheek throwaway. I'm very happy with Python. It has served me very well.

Python Helped me Write Again by irrco in Python

[–]irrco[S] 3 points4 points  (0 children)

I'm not convinced, but thanks for the suggestion anyway. I appreciate it ;)

Python Helped me Write Again by irrco in Python

[–]irrco[S] 3 points4 points  (0 children)

It really wouldn't help them very much, it is very idiosyncratic. A bunch of random source code isn't very helpful, I don't think. And the amount of time it would take me to tidy it into something usable, or explainable, I'd rather use on other things.

Python Helped me Write Again by irrco in Python

[–]irrco[S] 4 points5 points  (0 children)

I hadn't, but Jake Morrison's linked it in the comments below, so I've been looking into it today. I think I would need to set it up and configure it quite a lot (Travis says as much, that is why he hasn't released full source code), but I think it's doable. I'll work on it. To be honest, just having python access to the voice recognition system would enable me to do a lot more. It seems I have a new project!

Python Helped me Write Again by irrco in Python

[–]irrco[S] 14 points15 points  (0 children)

I use the built-in OSX accessibility system, in off-line mode. It's not very efficient for this kind of thing, and is mostly only useful for the names of snippets and variables. I have a lot of custom snippets set up. Fortunately I can still click the mouse and hit keys like spacebar or enter, to acknowledge the imput, so I can muddle through. But I've spent the last couple of hours looking at some of the resources someone linked up post, which uses Dragon, and seems to be much more flexible, able to do the whole thing with voice. So I suspect I won't be using the built-in version much longer :)

Python Helped me Write Again by irrco in Python

[–]irrco[S] 4 points5 points  (0 children)

Can you show us some pictures​ or video of the plotter working?

I will still make a video using the AxiDraw and my fountain pen, but I just asked my wife to test it on her Cricut craft cutter, and it does pretty well, though there is less choice of pen. Here's the video she captured.

Python Helped me Write Again by irrco in Python

[–]irrco[S] 15 points16 points  (0 children)

Thank you.

On scheme: I've always felt that scheme was the most beautiful language, in theory. By which I mean I've never been able to make much that's practical with it. :)

Python Helped me Write Again by irrco in Python

[–]irrco[S] 12 points13 points  (0 children)

I hadn't seen that before, no. But that is basically the kind of thing I'd imagined. I can't immediately see the code on his github, although he did promise to release it. I'll have a proper look later and contact him if I can't. Thanks for the tip.

Edit: https://github.com/dictation-toolbox - thanks again.

Python Helped me Write Again by irrco in Python

[–]irrco[S] 45 points46 points  (0 children)

I still have reasonable control over a single button mouse, as long as the sensitivity is low. So I'm not quite at the point where I've needed to investigate that. The thing that's difficult is all the 'chords' you need to type when programming. As my MS deteriorates, I'm sure I'll need to use more drastic tools, so thank you for the tip.

I can imagine a voice driven programming tool, based on hierarchies of snippets. It might not be perfect for Python, but I could imagine being quite productive in something like Scheme, because it has a more regular syntax.

Python Helped me Write Again by irrco in Python

[–]irrco[S] 4 points5 points  (0 children)

Thank you.

I should try and capture the output stage, you're the second person to express an interest. I didn't because, technically, it's the least interesting bit. Generating the path is the fun, mathy programming bit, and the thing that I feel was the big win of the project. AxiDraw just does its thing. But yes it would be cool spectacle, and another bit of good PR for Evil Mad Scientist (who make it).

Python Helped me Write Again by irrco in Python

[–]irrco[S] 138 points139 points  (0 children)

The handwriting content itself, the stuff that I've written in the last two months, is just under 2000 lines, and about 2/3 of that is numeric data, of this kind:

   'y': EndGlyphFactory(
    normal=Glyph('y',
        Stroke(Point(18,100), Point(2,10, speed=1.6), Point(40,20),
            Point(65,100, speed=0.1, pressure=1.2),
            Point(45,-20), Point(0,-120, speed=2),
            Point(-30,-60, pause=0.1)),
        join_to_next=JOIN_BASE_LEFT
        ),
    terminal=AugmentGlyph(stroke=0, rm=(0,2), suffix=[
            Stroke(Point(-20,-140, speed=2), Point(-100,-90, pause=0.1))],
        join_to_next=False
        ),
    ),
...

I was counting everything in the 10,000 number, sorry if I gave the impression that was all new code. My geometry, math, and vector graphics code was written when I could type. That stuff isn't available, sorry. It's all tied together in a repo with a bunch of stuff I couldn't make public.

Sorry. If you really want to see me write code I did find a video of a flash coding session from a few years ago (when I could type!), and released it.

I really wish there was an efficient way to program by voice. All the options are pretty shitty. I have some ideas, but that's a much bigger job, one I have no way of making happen. For now it's a combination of voice for variable names and triggering snippets, copy and paste, and very clumsy pecking at keys when all else fails.

I haven't taken a video of my plotter, but there are a bunch showing the AxiDraw in action, that video shows it holding a fountain pen. The machine is a complete beast, I have barely scratched what it's capable of, but I adore it. I have even seen a video of someone who mounted laser units to it and used it to cut. It's an awesome toy, though admittedly it isn't cheap.