Cwmwenallt Musings

December 6, 2010

More on Accessible Video

Filed under: Timed text, Work — Tags: , — Sean @ 5:05 pm

Today I’ve uploaded a new slightly better looking version of the demo, and added a new feature: extended descriptions. Descriptions convey information about what is happening in the image to those that cannot see it, and are the analogue of captions for the audio space. This brings up one of the remaining big issues in HTML5, which is that if one wants to associate another media resource with the main video, then there is no really satisfactory way to do it. You might want to go and play with the feature a little and then come back to follow the discussion.

For the ASL video, absolute synchronisation is not that important, since the grammar of sign is such that it is very difficult to get a close temporal correspondence between the two languages. To align the ASL then it was ‘simply’ a matter of obtaining a video of the same length of a sign interpreter who listened to the tape and then signed an equivalent.

(Side note, this video was extremely hard for the interpreter to sign, as the pace of the dialogue is so fast, she needed two or three takes to get it fast down, something that she would not normally  need in the course of ordinary dialogue. She was a real professional, and a trouper for sticking with it)

Then in the Javascript there is the following code:

    if (!videoElement.paused && asl) {
        if (asl.paused) {
            asl.play();
        }
        asl.currentTime = videoElement.currentTime;
    }
    else if (videoElement.paused && asl) {
        if (!asl.paused) {
            asl.pause();
        }
        asl.currentTime = videoElement.currentTime;
    }

This  is called on the timeupdate event handler for the main media and simply moves the ASL timeline to stay in synch. This is very rough and ready, but it seems to work in IE9 Beta and Safari, although maybe not so well in Firefox. What we really need in HTML5 is the ability to slave one video to another, in my markup I’ve added a ‘syncto’ attribute; which is intended to define this relationship.

        <video id="theASL" syncto="theVideo" poster="RealPCPride_Thumb.jpg">
           <source src="RealPCPride.asl.mp4" type="video/mp4" />
	   <source src="RealPCPride.asl.ogg" type="video/ogg" />
        </video>

For playing audio descriptions however things are a little more involved since the timing needs to be a little tighter. For non extended descriptions, the simplest option is to just provide the video with two audio tracks, one with pre mixed descriptions, and one without. For extended descriptions however, we want to trigger an audio clip at a given moment. I’ve added annotations to the TTML example with pointers to the audio file:

      <p
        ms:audio="http://www.cwmwenallt.com/ttml/audio/RealPCPride.en.001.mp3"
        dur="0.8s" begin="00:00:00:18"
        ttm:role="description" xml:id="description1">
       Open on a man in sports jacket and tie in front of a plain white background
       waving. An email address sean@windows.com is overlaid
      </p>

In the code when this <p> becomes active, we pause the main video, and trigger this audio , by setting the src of by a new <audio> element added to the DOM to the value of the ms:audio attribute. The <audio> element has a handler to restart the main video on the ended  event.

This works, except for the network delay in loading the audio resource, but its not particularly ideal. What I think we need is a combining operator which describes how the additional material interacts with the primary sourced media.

November 24, 2010

Mini-series: W3C Timed Text (TTML)

Filed under: Timed text, Work — Sean @ 1:06 pm

 

Having been involved with TTML now for best part of a decade, and with it finally coming to be a W3C recommendation as of 18th of November, it’s something of an end-of-era time for me. So following on from my last post , I thought I’d develop a little series talking about TTML, what it is, why it is what it is, and also expand a little on how I think we should go about integrating it into HTML5. I’ve written up a draft specification for this, and this is essentially what I’ve implemented in my Javascript demo. (I toyed with the idea of trying to do it inline here, but not sure how Wordpress would handle it).

The aim of this script is to make it drop dead simple to add TTML based closed captions, subtitles, chapter marks etc to your <video> page; all that is required is to add this line into the <head> section of your HTML:

<script src="ttml.js" type="text/javascript" > </script>

Point to the location of the script, then you need to add new <track> elements to point to your caption/subtitle/karaoke file(s). In the demo I use three track files:

       <video id="theVideo" controls="controls" poster="RealPCPride_Thumb.jpg">
            <source src="RealPCPride.mp4" type="video/mp4" />
            <source src="RealPCPride.ogg" type="video/ogg" />
            <track src="RealPCPride.wmv.en.captions.xml" kind="captions" srclang="en-US" label="English captions" />
            <track src="RealPCPride.wmv.en.descriptions.xml kind="captions" srclang="en-US" label="English text descriptions" />
            <track src="RealPCPride.wmv.en.xml kind="subtitles" srclang="en" label="English captions and text descriptions" /> 
                Short video from the “I’m A PC” ad campaign..  (needs HTML 5 capable browser)
        </video>

The script will add a selection element into the page, enabling the user to choose between them. That’s it!

The script is currently working in IE9 beta and Firefox 3+, and I’m working on Safari support. Still stuff to do; in particular styling the select so that it looks a little more integrated with the native video controls and handling multiple video elements.  I’m also currently scoping out how chapter files should operate. But the basic caption and subtitle kinds are reasonably well supported. You should also notice that the demo adds a second video for sign translation, which is synchronised with the main video. HTML 5 doesn’t actually add tools for this yet, so this is achieved using a second video element and some script, eventually I’ll add in support so that the sign translation can be inserted using the <track> mechanism.

Without getting into the details (see the specification for that), roughly what this does is analyse the timed text file for the content that should be active at the current playback time, and then inserts equivalent elements into the host DOM.

One nice feature of this approach is that since the timed text gets integrated into the live DOM of the page, you can override the built in styles of the caption file. The script converts any role and xml:id attributes it finds in the timed text, into class and id attributes and maps the <region> element to a div with @class=”ttml_cue”  currently I prefix these with ”ttml_” to try and reduce clashes with the host page; not sure if there is a cleaner way to do this without better namespace support.

Anyway, now if I have a caption like the following :

<p xml:id='subtitle1a' ttm:role='caption' begin='00:00:00:27' end='00:00:02:22'
>Sean: Hello.  I’m a PC,</p>

Then in my page CSS I can add a rule like:

.ttml_caption  {
	font-style:italic!important;
 }

This will override all the captions to be italic, and if I want to be specific:

#ttml_subtitle1a  {
	color:red!important;
}

Obviously if you want the TTML to take precedence, and only provide defaults for styles the TTML doesn’t specify, you can leave out the !important keyword.

OK, hopefully that’s given enough of an introduction, there’s lots more to say; next time we’ll get a little more into what Timed Text is all about.

Ciao.

Sean.

November 18, 2010

Windows Live Writer Test

Filed under: Accessibility, Timed text, Work — Tags: — Sean @ 2:02 pm

OK, so this blog hasn’t been updated much recently; I’ve been busy OK. Rest assured there is another stringed thing project in the pipeline, based on an art box and a resonator kit; but that’s for the future.

One of the things I’ve been busy with recently at work is the HTML5 working group, and in particular the choice (or preferably non-choice) of caption format. Now that the <track> element seems to be stabilising,  I’ve put together a demo of how captions , text description and and subtitles in  W3C Timed text could be integrated using just this feature now, rather than waiting for the browser implementations to catch up. To make sure its cross browser, I decided to do it all in Javascript. If this remotely interests you, the current demo is here You’ll need IE9 or a recent build of Firefox to view it (Sorry Safari users, it doesn’t work for you yet; but I’m working on it; I’m not planning on testing Opera though).

If you don’t have an HTML 5 powered browser here’s a screenshot:

screenshot of TTML demo in IE showing bill gates, a caption and a description

Longer term I aim to get this cleaned up and finished and posted on my Codeplex site (which also hasn’t seen much love recently) with audio descriptions, chapter navigation and stuff, so don’t go running off with the code just yet.

Oh, and the title? Yes this post was written using Windows Live Writer (soooo much nicer than hand crafting in notepad and pasting into Wordpress – one of the other reasons i haven’t blogged lately!)

ttfn.

March 14, 2010

Sing the body electric

Filed under: Guitar, building, ghettocaster — Sean @ 7:02 pm

The remaining build activity for the Ghettocaster was to install the electronics, and I decided to take a somewhat unconventional apporach here. You might recall from the initial sketches and early posts, that I intended to put a telecaster like control bar on the front of the body, however after finishing the body a week or so back, I’ve more or less gone off that idea. Partly because I like the look of the wood, partly beacause I probably wouldnt use the controls that much anyway, and partly because it would mean opening a big hole in the front, which would then make the body entirely drilled through, which I thought might lessen its stability.

In the typical SG scenario the jack plug would emerge from the front deck of the body, again to preserve the wood finish, I dont want to do that, so nstead I’ve decided to route both pickup signals off the guitar unmodified, by using a stereo jack plug and route it out of the back-side of the body.

Location of jack plug socket

I bought a stereo jack plug for this, but unfortunately as you can see the there is quite a bit of wood between the cavity and the external surface, to get the jack plug to emerge at this point would have required taking a large amount of wood out, but all I wanted was to drill a small hole. So then I had a bit of a brainwave, I took a stereo minijack to jack adapter, and wedged it into the socket, like so:

Location of jack plug socket

Form the back of the guitar, all we see is a fairly neat mini jack socket. Obviously this means I wont be able to use the standard 1/4 inch jack plugs with this guitar, but I have a splitter cable which converts mini stereo into two quarter inch jack sockets (sorry forgot to take a picture of that).

Location of mini jack socket

So, then it was just a question of wiring it all up. I soldered wires to the stereo socket, but as there wasnt any pots to solder to for the remaining wires, I just screwed in a bit of block connector, which was handy as it allowed me to have a couple of goes until I got all of the wires in the right order.

Rear chamber stuffed with wires

So that was it, time to plug in and test. And it works!

Here is a small snippet of how it sounds, this is running both the neck pickup (as the left signal), and the bridge pickup (as the right) into Guitar rig, there are two overdubs here, one for the rhythm part and one for the lead. Both are using the “Jimi’s little wing” GR setting with a few tweaks. Apart from the dodgy quality of the playing, which hopefully we will be remedying over the next year, I think it sounds pretty good.

So thats it, basically done. All that remains is to get a couple of plastic covers for the rear chamber and the pick guard (when I finally settle on a shape!).

Toodle pip twangsters,

Sean.

February 28, 2010

Bodytalk

Filed under: Guitar, building, ghettocaster — Sean @ 4:46 pm

The last couple of weeks, as time has permitted, I have mostly been focussing on the bodywork of the guitar. After cruising the guitar builder forums, I decided to finish the body in a product called tru-oil, which is a linseed oil based varnish intended for gun stocks; but makes a nice smooth and breathable finish for guitars. I also took the trouble to line the pickup pockets with a special conductive paint I got from stewmac. I was going to use copper foil, but this seems a lot neater.

Product placement:Product placement

After about 5 or 6 rounds of sanding, and rubbing on the varnish, the body looks pretty splendid, and smells like an old school desk. Hopefully the smell will wear off!

I didnt go to a really high gloss shine, although apparently the tru oil will do that, because I wanted it to look and feel like a piece of wood.

Body shot

In this second picture I angled it so you can see it catching the light, which shows of the finish a little better.

Body shot

here is a closeup of the pockets with a couple of coats of the conducting paint applied.

Painted pockets

After assembling the guitar and a fair bit of fiddling with the little screws on the nut and bridge, it was finally set up and in tune.

Body shot

And here she is in all her glory. Not quite done yet, still have the electrics to sort out, and the pickguard is roughly cut out of a bit of mounting card (and not the final shape either). But it does sound quite good, the card acts as a little sound board and it really holds a sustain well.

Full shot

So. its official, I’ve built a guitar.

Next up is the electrics, where I’ve had a bit of a brainwave. So hold tight for that. Also in terms of practice, the black water side piece is coming together fairly well now, although I’m not going to be rivalling Bert any time soon, so I’ve added a new piece to the schedule. its called Andante in C by Mauro Giuliani; better known to the over 30’s in the audience as the “Tales of the Riverbank” Theme Music, the score is available here if you want to have a go, its fairly straightforward although there are a couple of tricky middle bits.

So thats it twang fans, until next time.

February 15, 2010

Doing my nut

Filed under: Guitar, building, ghettocaster — Sean @ 3:15 pm

Hopefully the irony in the title translates, after you’ve read the article.

Today was quite a watershed day for the ghettocaster, I was going to post on the Sunday assessment, albeit a day late; but I just had to get this out there. The Sunday assessment for this week may go out a little late. If you are interested however, the practice piece for the coming few weeks is the traditional tune “black water side”, as played by Bert Jansch; a beautiful piece and probably beyond me, but I’ll be doing a separate post on it soon.

So – back to the ghettocaster. I’ve been stressing about whether this concept is actually going to work, as the profile and angle of the neck are set up for the higher Gibson style bridge. I wasn’t helped by the fact that the nut as supplied with the neck, not only is a rather ugly black, also has zero clearance for the string.

The original nut, as supplied with the neck

So, I thought, what I probably need is an adjustable nut so that I can dial in the height once the guitar is put together. A quick search revelaed more or less what I was looking for on eBay, and a few days later, here it is, in a rather fetching matching gold-bling finish:

New locking nut in fetching gold colour

So, barely pausing to think through whether this was a good idea, I proceeded to slice off the back of the nut slot to create a little platform for this nut to sit on:

Removing the back of the nut slot

And after a little sanding and cleanup with chisel, this is what it looked like.

Finished nut ledge

Unfortunately, this is where the trouble started; the first problem was that when I tried to screw the block in place the little gold screw proved to be rather weak, and conveniently sheared off inside the wood. So that set me back a frustrating hour trying to extract it. Which entailed lowering the base of the platform by a couple of mm in order to get the grippers to attach to the stub of the screw

Sheared screw

Then, blow me if the next one didn’t do exactly the same, Aargh! However by this stage I’d lowered the platform as much as I dared, but also I’d noticed another problem. When the height raising screws were engaged, they cause nut to angle slightly, which moves the leading edge of the nut back from the end of the fretboard by about a millimeter. My concern was that, even if I could compensate for this by moving the bridge, it would mess up the positioning of all the frets, making the whole thing impossible to tune.

So, I slept on it.

In the morning I resolved to fix both problems by a fairly radical step, which was to remove 1mm from the end of the fretboard. This solved both issues, by moving the screw hole away from the stub-end embedded in the neck, and allowing the nut to move back and preserve the original distance from nut to first fret.

And, seemingly it worked, however to check it out properly I really needed to actually attache the neck, so out with the drill (finally located it in the old piggery!), and whizz whizz, four neat holes:

Holes drilled for neck bolts - front view

And here they are form the back:

Holes drilled for neck bolts - back view

Then I bolted the neck on, unshimmed to see what the default angle would give, and after screwing down the bridge plate, I attached a string:

First string mounted

It actually became a guitar for the first time…. wow.

What’s more, after a little tentative tuning, taking it slowly in case anything gave; I actually got it up to concert pitch:

first string in tune

I fiddled around with the height of the nut to set the string clearance at the first fret to 0.09 , (midway between the recommended settings in my trusty Hanes manual for the telecaster), then I raised the bridge till the buzzing stopped, which was quite high, but still well within the prameters the bridge screw allows. You can see the height in this picture:

Height of bridge after eliminating buzz

I had to dial in a little extra neck relief, which enabled me to lower the bridge a little, so now this E string is pretty playable the whole way up the neck. I checked the intonation at the 12th fret, and its pretty close, the notes at the other frets seem to be fairly accurate too. I still need to figure out what they actually should be based on equal temprament tuning, but I’m fairly confident now this is going to work.

Whew,

See you next time for the rest of the intial setting up, and more on actual playing.

toodle pip.
Sean.

February 7, 2010

Where’s that confounded bridge…

Filed under: Guitar, building, ghettocaster — Sean @ 5:17 pm

[spot the obscure Led Zeppelin reference - answers on a postcard please]

So, another Sunday comes and goes with no assessment, have I given up entirely you’re all [not] wondering. Well no, thing is I’ve been travelling which has made regular practice something of a problem (although I did find a creative solution – more on that in a later post prhaps).

However the point of today’s missive is to update you on the progress of the ghettocaster, which has been sadly neglected of late, although still oft in my thoughts. I took the opportunity while in the US to visit a couple of guitar shops, and taking advantage of the exchange rate, purchased myself a nice little Seymour Duncan Telecaster bridge pickup. And here it is mounted in the Wilkinson bridge.

Seymour Duncan pickup fitted into Tele bridge

The pickup doesn’t need to be mounted directly to the guitar – see how it hangs off the bridge:

Depth of pickup behind bridge unit

This means the bridge vibrations are transmitted to the pickup directly and so adding to that trademark twangy Tele sound.

But it does require a hole to accommodate that depth behind the bridge unit. And now the die is cast, I do have to whack out a little hole to put it in. So again out with the chisels (A router would probably be much quicker, but I don’t have one and am somewhat wary of losing a finger learning how to use one).

Anyway, before putting the pickup in the bridge unit, I carefully traced an outline on the body.

Markup of pickup shape on body

And then tap, tap tap…

Starting to chip out hole

…for about 45 minutes, until.

Completed hole

Ta. Da.

Well its a bit rough, I’m sure a router would have done a much better job, but the price was right, and the pickup fits. Most of the messy edges are going to be covered by copper shielding and the bridge pickup anyway so I’m satisfied.

Next issue is how to route the wire (that big black one in the picture above) out of the hole and into the cavity where all the controls will live. I can’t find my drill right now, so that will be an exercise for another day.

So. there we are, another small but significant step forward.

Oh and by the way I am practising still, if you recall the game-plan was to learn ‘Dee’ by Randy Rhoads; well I can just about play it all the way through now, but there are some tricky little changes in there, and its not that smooth. So I’m still working on it again all this week. Next week I’ll be getting back to the formal book plan.

So, thats it, keep on twanging,

Sean.

Older Posts »

Powered by WordPress