Audio! Woo woo!
Just the beginning, don't get wet.
Here is the git log.
day 020 - midi driver started There we go: alsa midi. The program plays all the 88 piano notes at ten notes per second. I use fluidsynth as a, well, synth. Run as: fluidsynth -a alsa /usr/share/sounds/sf2/FluidR3_GM.sf2 Then I launch compose. And then I connect compose and fluidsynth with aconnect: aconnect 128:0 129:0 Maybe not 128 and 129 for you. Run aconnect -l to see your ports. Maybe not 0 either. Well, you know what to do, don't ya? Next step is to generate an ordered list of midi commands from the score. It's not trivial. Not too hard, but requires some focus. And some synchronization between those funky threads that popup at each new functionality in there. I think all document's modifications and manipulations will be done in a unique thread which will obviously synchronize things by the mere ordering provided by the sequential interpretation done by the central processor unit. And these days this sequential stuff is not a trivial task. Optimizations gives work to zillions of "engineers" (I defy you to use a computer as an engine. Sit on it and turn it on. It won't move. If it does then you have a problem.) And modern computers put parallelism everywhere. It is supposed to behave "as if" it was our old beloved sequential processor (think 6502) but well, you know, bugs... Oh my, it's late!
And some audioshot, for a change.
[audio file: day_020.ogg]
Armatures and bars.
Easy.
Screenshot.
Yes I put a bar in the middle of an armature. And yes the two armatures are not the same on the sol and fa lines. You know what freedom means, don't you?
Clefs! Easy. The code starts to be messy again because a lot of code to handle clefs and notes is almost the same (if not the same) in size.c and plot.c. I don't know how I'll deal with that. We'll see. As it is it works but it's not pretty.
The git log of the day follows.
day 018 - handle clefs And there we go! the clefs! Sol, fa and do. First I put them in glyphs.c from notes.png via an export in gimp through the xpm format (export as 'toto.xpm'). Then copy/paste from that file and replace whatever with ' ' and '.' In (modern) vi, you do that easily with the V command followed by moving your cursor and then 's/x/y/g' where 'x' is the current characted and 'y' is the one you want. Ah, you can also add space at beginning of lines still with 'V', move the cursor and 's/^/ /'. Go learn basic regular expression, it's useful. Sometimes. I've seen some people go mad with regular expressions. I think I even remember a code that failed because of a way too complex regular expression in there. Simplicity, you and me we have a mission. Wait... the door bell just rang! Oh! laziness! thy are welcome! (I dominate the english language.)
And a screenshot.
Next time: armature.
Not much today, I just prepared the clefs in gimp, need to put them in glyphs.c and then use them. Sol, fa and do clefs.
Here comes notes.png.
I'm getting close! But the worst (user interaction) is like that hill I prepare my bike to climb with. It is said there is a terrific one in Italy at more than 20% all along or something. That's what I expect. That should be fun!
I love simplicity and how it's easy to play with that philosophical concept applied to real life.
Yes, writing software is real life. For me it is.
Blinking cursor!
The commit message? Okay.
day 016 - blinking cursor Smooth. It was just smooth! The X thread now has its pipe. There is a cursor thread. Both can be commanded by others through their pipes. Simplicity. A blinking cursor.
No screenshot, I mean, it's blinking.
Next steps? Clefs, "armature" stuff, bars. Then playback. Then, what about some sort of interaction, hum? I mean, it's an interactive program after all. Or is supposed to be. Somewhere up there deep in my marvelous (I didn't write perfect but I thought it hard) brain this program is interactive. Then I'll be done for a while. I'll go back to music study. It's all what it's about after all.
Cursor!
Here comes the commit message.
day 015 - cursor There it comes! Easy. I changed heights computation of lines/sublines and whatever in size.c because they were wrong. The cursor revealed that. I would have thought that part to be harder. I still need to make it blink. There will be a thread and some mechanism to start/stop/restart the blinking. When you do something the cursor has to be plotted right away, as some sort of reset of its blinking timing. For some reason you don't care about I did use vi in gnome-terminal today. I played with the mouse wheel. And the cursor was moving. Except its blinking continued as if nothing. So you wait for the "blink off" time and then you scroll like hell and when the cursor becomes "blink on" again it has moved a lot. It moved while being totally invisible. This is wrong. What should happen is when the cursor is moved it's visible right away and becomes invisible only after you stop moving it and its "blink on" period is over. And this "blinking on" period starts counting only after the cursor has stopped. Funky bug in a bloated software. It won't be in 'compose'. Or so I think. Time to sleep.
And the screenshot.
Minilines for high and low notes! If you want some cake, I have a piece of it.
Screenshot? Okay. (Extracted from the program. It's the third line when you run it.)
Heights of lines are better. Maybe even correct. Joining staves of same line is also better.
Note heads are aligned! Woo woo!
Not much work today. Tired.
Accidentals are aligned! I introduced a reference point in the glyphs. Only using the y for the moment. And only for accidentals.
Bounding boxes are correct! Well, as long as a stem is longer than an accidental. I should fix that at some point...
A small screenshot. Note heads still not aligned. Next time.
Contact: see here
Created:
Fri, 03 Jul 2015 19:10:41 +0200
Last update:
Fri, 03 Jul 2015 19:10:41 +0200