Friday 26 February 2021

Update on the concept chapter: Music

In my last post 2 weeks ago, I talked about making a test chapter for the multimedia book project. I anticipated being done a week ago, but sorting out music took me much longer than I thought.

The audio library I'd planned on using turned out to be not very suitable for my purposes, and I ended up deciding to work with the Web Audio API directly.

But after all my fiddling around, the audio system for my custom engine is basically complete. There are some little details left to work out, but the test chapter plays through, and it sounds beautiful.

My main frustration with other audio queueing systems I've used is transitioning to the next track when the current one is playing in a loop. The two typically available options are:

1. start the next track immediately, interrupting the current track

2. wait for the end of the current loop, then start the next track

Option 1 allows us to be very responsive, and update our music immediately for events in our game, but it interrupts the musical experience. Option 2 preserves the flow of the music, but introduces a delay in our responsiveness - and possibly quite a long one, depending on the length of our loop.

Neither of these options appealed to me. I wanted to do something more like

3. wait for the end of the current musical phrase, then start the next track

Of course, this necessitates having some different data.

I decided to save each phrase as a separate audio file, and sequence them dynamically.

Scheduling was my biggest roadblock with that approach. I spent a lot of hours banging my head against the wall trying to figure out how to play the next phrase exactly at the end of the current one, with a seamless transition. Finally, just a few days ago, I found a wonderful article by Chris Wilson about using javascript timers to schedule sounds on the Web Audio clock.

After that, I was able to get my "phrase sequencer" working, and I spent my morning today composing music instead of struggling futilely to get sounds to line up properly.

The concept chapter is now very close to done. What's left is mostly engine tweaks.

After a week and a half of frustration, I feel like this is really coming together.

Friday 12 February 2021

Planning is hard

 I've been struggling with the balance of planning since I started writing.

I am not a patient person. In some ways, that's a strength. I don't wait to start things, unless I have a very good reason to. When I decided I was ready to write my first book, I started that day. When I decided to get fit, same thing. Unfortunately, I've historically tended to grow impatient with the planning process, and jump into projects before I've fully thought them through.

Early on, I would throw together a plan in an evening, start writing the next day, and hammer out an 80'000 word first draft in a couple months. The trouble with that method, of course, is that you have to work from an ill thought-out, often vague plan, which means you're likely to need multiple full rewrites. The rewriting was often where I'd get stuck. The gap between that first pen-and-paper draft, and the second planned, polished, typed draft seemed too wide to cross at times.

And of course, this method is even worse for something heavily-illustrated, like a graphic novel, or a visual novel.

One of my last big writing projects was a complete rewrite of one of those six-month-thrown-together first drafts. I threw out almost everything but the character and the basic premise to move the story into a larger setting I'd been developing. All I really had left was a sense for the flavour of the story, and even that I didn't have properly nailed down. I worked from a very rough outline, and my idea for what the story was supposed to be changed as I went. Halfway through the draft, I'd changed my mind about the story's core themes and how to develop them several times. Writer's block was derailing me at least every other chapter.

It wasn't long after that that I realized the strategy I'd been experimenting with of "write it straight through, changing past events as necessary" was not working in the slightest. And it wasn't long after that that I realized the writer's block - or perhaps writer's confusion - that pervaded the project ran too deep, and finally decided to shelf it for a while.

Over all, it was a very good learning experience. I realized if I wasn't ready to plan something in detail, I likely wasn't ready to write it - unless I wanted to do a six-month-thrown-together first draft. (Come to think of it, that project might have benefited from a second first draft right about then.)

 For my current project, I'm leaning, perhaps, toward the opposite extreme of planning. I have a careful outline of every chapter, and even every scene at key points. I have files on all the characters and locations. I have outlines of all the subplots and character conflicts, and how they develop through the scenes and chapters.

My goal is to write a first draft that won't require major rewrites, since I want to publish this project as a web serial.

I'm trying to fight back against that impatience and take things slowly.

After my three week planning marathon, I decided to switch gears for a moment, and make a complete test chapter - illustrations, prose, music, code. I'm about halfway through it at the moment. Currently, I'm working on stringing the story together with the illustrations. It'll probably be done in about another week. It's coming together even better than I expected.

When the test chapter is done, I'll go back to the plan for a while. I've realized as I worked on the illustrations that I messed up on some of the logistics for where the characters were and when, so I'll fix that. I'll also take another wide look at the chapters, and the conflicts. I want to do at least one more test chapter as well, to see if I can streamline the process a bit more.

The current test chapter has some potential spoilers in it, so I probably won't be publishing it any time soon, but I'm leaning toward making the second test chapter into something of a teaser/short-story, so I may be able to show that soon.

OK. I guess that's all for now. I'll touch base soon.

Thursday 11 February 2021

Let's try again

I tried to start a blog here about 6 years ago, and it didn't really work.

I've grown a lot since then, but the original idea of this blog still appeals to me.

I'd like to talk about what I'm working on, and share what I'm learning as I go.

My current project is very different from the one back then.

I've always been pulled in a lot of different directions. I make art, and music. I write stories and code. Ever since I wrote my first novel, almost 10 years ago, I've been looking for ways to combine my media. The graphic novel I used to blog about was one of the my first serious attempts at this. Since then, I've worked on a number of projects.

A year or two ago, I got it in my head that I wanted to make something "halfway between a novel and a movie". I eventually realized that the thing I was imagining was, roughly, a visual novel, albeit sans many of the conventions of the medium.

So I experimented with making visual novels.

I used Ren'Py for my early attempts (wonderful software - would highly recommend it) but, since I wanted the final result to be web-based, I ended up hacking together a custom engine in javascript/HTML5.

For my illustration, I've shifted to physical media in the past year. I've been drawing a lot of comics in pen and paper, sometimes adding a bit of watercolor or marker. For one of my visual novel experiments, I decided, on a whim, to try wax crayon.

And I immediately knew that this was the medium for my next major project.

With this little epiphany, I was able to power through all the plot and character planning I'd been struggling with for a year and a half in a matter of weeks.

So now I have a bare bones engine for web-based static visual novels, an illustration style I'm happy with, and 14'000 words of detailed planning. Now I just need to turn it into a book!

I guess that part may be easier said than done.