A few weeks ago, I posted the Aurebesh typing test. Since I’ve recently started learning elisp, I figured that I should implement the typing test as a feature for emacs.
The code below is terrible with bugs and problems, but heck, it’s my first elisp program after all. My goal is to improve the version over time and to add features such as logging results in a separate file and displaying a progress statistic. To use it, you’ll need to first install the Aurebesh font.
I’ve changed the last program a bit to use glMapBufferRange instead of glBufferSubData. For this specific example, there isn’t really any advantage in using glMapBufferRange over glBufferSubData, but in general, it has better performance than glBufferSubData.
I was actually going to change a bit more code, but I wasted quite a bit of time for a new laptop (from Santa) which turned out to have hardware issues (50% of laptops I’ve owned so far had defects when I got them – what a jinx I am).
You can find my latest OpenGL program as always on github.
The problem with glBufferData as well as with glBufferSubData is that you need to allocate some memory provided by your application before you can copy it to memory owned by OpenGL. Let’s assume you have a file with all vertex data. Wouldn’t it be nice to directly read that file into OpenGL memory? That’s exactly what glMapBuffer and glMapBufferRange is good for. You avoid wasting memory and copying operations. If you compare my code in ‘OpenGL – Beginner 4’ and ‘OpenGL – Beginner 5’, you’ll find that the usage of glMapBufferRange and glBufferSubData is very similar.
I’m not going to explain the details of Morse code here, since there are lots of good explanations on the net. For example, I used this page for a short memory refresh in Morse code.
Please be aware, that the following utility is a very basic version and has very limited functionality. I hope it’s useful to learn the alphabet as well as digits, but it is far from teaching you proper usage of Morse code. What’s wrong with it or better to say, what’s missing?
The length of dit (•) and dah (-) is only approximated. Let’s say you start your first dit with a duration of 1 second. Obviously, the pause between each dit/dah should be exactly one dit and the length of each dah should be 3 dit’s. The testing tool below only measures the first pause of the test and determines the duration of a dit and dah. The pause durations afterwards are completely ignored. Also, the test considers everything below 1.5 * dit duration as a dit and everything above as a dah. My goal for a future version of this tool is to add a nice realtime graph which shows how long the actual pauses, dit’s, and dah’s were. Such a graph should help to improve timing.
For beginners, it would be nice to narrow down the amount of letters/digits. E.g. only letters a to g are asked.
The test only measures your skill in coding letters. It doesn’t test for words or even sentences. Therefore, it also doesn’t test for comma, slash, period, and question mark. In a future version, I would like to include an additional test which does request words and sentences.
The current test only rates the amount of correct/wrong answers. It would definitely be nice to see the average speed value as well.
Currently you can’t test the other way around. That means, you can’t listen to a morse code sequence and then write what you heard.
I finally wrote the next beginner program which uses the OpenGL glBufferSubData function. The advantage with this function is that you don’t need to define a huge buffer upfront, but instead provide the graphics card small buffers piece by piece.
I added a little thread to my program and call the draw function every 200 milliseconds. The program is as the ones before fairly unspectacular. All you see is a moving rectangle.
For my next program, I’ll use the glMapBuffer function which is generally the better function to use. Why and how to use it will be described in my next post.
Just a bit more than a week ago, I wrote a post about me learning Aurebesh. I’m still far from proficient, but I continue practicing and, even more important, enjoying it. As mentioned in the one post, I’m using a few online tools to practice and after using Patrick Lambert’s timed translation tool for a bit, I felt like writing my own version with slight changes.
I really like Patrick’s little utility, since it gives you a nice and quick progress feedback. After using it for a bit, I could think of a few improvements. I, for example, don’t quite like that I have to press enter after each character. I consider that redundant and it makes my result count lower than it could be. Furthermore, his implementation continues with a new random character even if the user input was wrong. I prefer being stuck with an Aurebesh character till the correct input has been provided.
After writing my own little version and trying it out, I figured that it would be nice if I saw the number of wrong inputs as well. After all, a high number of correct inputs looks great, but if the number of incorrect inputs is high as well, it kind of diminishes the success.
I hope you find the little Aurebesh typing test feature useful. Please let me know if you can think of something to improve it even more.