Bromley Learning Alliance

Thursday 23rd November 2006 was the date for the Bromley Learning Alliance celebration event, where children who took part in the Summer Project got to share their work with parents and friends. Matt and I were presenting to an audience of approximately 200 people and we were delighted to be leading the parents through the work, commenting on it and talking to the children as each film was shown.

What struck us both was the absolute quality of the films in terms of the story behind each one. The animations they created (all stop frame, all using the excellent iStopMotion from Boinx) may not have had the precise model making skills for a Nick Parks production, but the digital literacy the children exhibited was astonishing. The participants were all aged from 9 to 12 at the time of the event, which is a very young group to do this kind of work with.

They are not the youngest, however! That honour falls to Cressing Primary School who we worked with to see if stop frame animation could be used with 6 and 7 year olds. We found that it can, but you cannot simply go in and do it without a certain amount of preliminary work.

The Bromley pupils were part of the Bromley learning alliance, which was formerly known as ‘SEEVEAZ’. We have worked with them for the past five years running summer projects in digital creativity and they have carried the torch on further than we originally anticipated.

Top marks to Bromley, then – and our sincere thanks to Andrew Ferrier, Sue and Merrill for their support and time in making this all happen.

We made the DVD for the children to take away on the night, but there were so many issues with the media that we will re-do it for them free of charge.  This is the first time such a glitch has descended on our DVD production routines – I only hope the re-make will be better! We use DVD Studio Pro for the authoring and I am confident that the problem lies in the media or the audio format we used. I’ll investigate… but my apologies to the children of Bromley who have a disc that may not work well!

Using ‘Grep’ with BBEdit

I learnt an interesting thing last week, the day after I had been working on some DVD Studio Pro subtitles. I had used Excel and BBedit (from barebones software) to do some find and replace operations in order to re-structure the subtitle file that was sent to a friend of mine. As it turned out my familiarity with Excel was good enough to get the file into the correct format, but there were still some bits and pieces that needed tidying up manually. With several hundred lines of sub title to work through that was always going to be a challenge, so I stopped at that point. The subtitle would import into DVD Studio Pro fine, and so I felt reasonably OK that the job was close enough to allow my friend to finish it off without too much trouble.

I mentioned the struggle I had with this to my colleague Alex Blanc, and he suggested I used ‘Grep’. Now, I have seen the checkbox in BBEdit’s ‘find and replace’ dialogue, and I had a vague idea that it worked with regular expressions, but I had not taken the time to read up on it or try it out. I was, in fact, completely in the dark.

Which is a reasonable place to be, for a lot of the time, when it comes to really geeky things!

However, Alex went to work on instructing me about how to use Grep. It turns out to be a really flexible language which has a small instruction set that you can adapt and use to do very intricate find and replace routines. For example, in the entry about DVD Studio Pro subtitles (a couple earlier than this one) you’ll see that the file format was all wrong. There was a full stop towards the end of the timecode that should have been a colon, but I couldn’t simply use find and replace to change all full stops to colons because there were also full stops within the subtitles themselves. However, using Grep you can write a command that looks for specific instances of full stops nestling between digits, and you can be pretty explicit about the string of digits before and after the full stops that you want to replace.

When complete, the search field in BBedit looks a bit odd, using strings like this:

^\s\d{1,3}:\s(\d{2}:\d{2}:\d{2})\.(\d{2})\s(\d{2}:\d{2}:\d{2})\.(\d{2})\s*\r\s*(.+)$

But when you understand what it is saying you can really get a lot out of it. Each character in that string represents a different command. For example ‘^\s’ is looking for a space character, ‘\d’ looks for a digit and the curly braces give the search criteria for the digits. Reading along that line then the function is going to look for a series of digits followed by a colon, then followed by a space and then another distinct series of digits (notice how the distinct set are held in parentheses) ending with a full stop and then another two digits…. and so it goes on.

What that string is doing is describing the general format of the incorrect timecode from the subtitle file and setting up sections that we can rely on when replacing the content.

Now, Alex is particularly gifted with this stuff, in my opinion, and can see the way through a lot of the code like he was part of the Matrix. I, on the other hand, tend to need time to go through it all slowly after being shown it so that I can then begin to understand it in my own time. I think it’s an age thing…

Anyway, Alex had written the Grep string in less than ten minutes, having tried a couple of versions first to get it working. The end result was that in about ten minutes, using only BBEdit, Alex had re-structured the subtitle file perfectly – mine still had issues that needed sorting out manually.

I’m not sure what message this gives me, really. I am now reading through the Grep manual that comes with BBEdit and it makes a lot of sense. It can do ‘If:Then’ type structures and you can nest commands quite deep. This gives it a lot of power and more flexibility than you can get by using Excel alone. Those of you reading this who are quietly chuckling away because you have been using Grep in Linux or Unix installations should share a bit of that knowledge… it really is a very useful tool, if slightly arcane to get to grips with!

WordPress Themes, Open Mist, Freshy

ocean mist theme screenshotSo, here I am using WordPress instead of Drupal – and I’ve been busy making sure the old Drupal blog moved successfully to this and on a new server as well. There were all sorts of considerations, including how to keep the ‘googlejuice’ so that I didn’t disappear completely off the search engines.

However, the most important thing after the technical work is to get it looking right, right?

So I began trawling through the various themes available for WordPress. After several goes I settled on ‘Ocean Mist’ by Ed Merritt – a lovely theme and some nice touches to it. I particularly like the clean lines and the page listing in the sidebar. The use of a drop down menu for the archives is genius, too. However, it still wasn’t quite what I wanted – the ‘edit’ and ‘reply’ blocks seemed too, well… blocky. I also felt that there were some cleaner themes out there that weren’t quite so busy to look at. There were also a couple of bugs in the code that meant if you were not logged in and tried to leave a comment the sidebar would shift down below the main body content area – easily fixed once you have tracked down the offending <div> container in the comments.php file (It’s the last closing tag that needs to go down one line…)
I settled on another called ‘Freshy’. This one has some seriously cool features, including a dashboard configuration tab allowing you to set the look and feel to a number of different parameters – change the header image, change the nav bar colour scheme and so on. I also prefer the additional white space and the way tags like <pre> are dealt with… nice table listings which is important if you are copying out lines of code, for example.

Ocean Mist has been updated to version 1.1 and I ought to give that a go as well – I did try, but there were some problems getting it to run. I couldn’t face working my way through the code again, but I may look at doing so in the near future.

Ocean Mist certainly has some very good qualities, but needs a few finishing touches. Ed Merritt seems to have a winning theme there, and I’d love to see it further developed.

DVD Studio Pro Subtitles

dvd iconIf you have used DVD Studio Pro you will know that you can enter subtitles directly in to the app, but when you do it is a job to do anything with them! An alternative is to have someone create a subtitle file for you… the trouble there is they often arrive and are pretty much unuseble since not many folk know how to write them.

I had one such file sent to me this week. The format was .stl and a different version as .txt – both are generally OK to use, but the file content was badly written.

The way you need the file to be set up is to have a start timecode (in the standard timecode format of hours:minutes:seconds:frames) a tab a comma another tab then the end timecode for the subtitle, followed by a tab, comma tab combination before the actual subtitle text itself. It should look something like this:

00:00:15:16 , 00:00:17:13 , Over here, quick… I think I can see it!

So, when I got the following format it presented various challenges:

1: 00:00:15.16 00:00:17.13
Over here, quick... I think I can see it!
2: 00:00:26.13 00:00:30.05
- OK - let me ring the police first!
- The others will be here soon!

I mean, you can see what the writer is trying to give you – they want you to see how the subs should appear on screen, but they have absolutely no idea of the work this now involves. First off, the time code is all wrong. It can either be 00:00:00:00 as a format, or 00:00:00;00 which would indicate ‘drop frame’ time code, which you see a lot in NTSC files from places like the USA. Occasionally the timecode starts at 01:00:00:00, which is OK to use as well.

The challenge is to quickly find and replace all of those full-stops with colons, without changing any full stops in the actual text for the subtitle. In the file I got there were many!

Second is the use of a line numbering system – and using a colon to boot!

Then there is the matter of missing tab marks, commas and the use of line breaks… It really was a mess, and would be a serious contender for making use of a subtitling application such as Belle Nuit. However, all I had was Microsoft Excel and BBEdit (which I don’t use a lot and am not sure of the capabilities).

So, the first thing I did was import into Excel and use the colon as a field separator. I could then remove the line numbering pretty easily. This left the remaining timecode in different columns with one having the seconds and frames in. As long as the excel columns are formatted as text (and not the default ‘general’ format) anything you type will appear as you type it. A quick find and replace in that column changing full-stops for colons should have sorted it, but it caused Excel to add in a further set of characters. Odd, but not too much of an issue. I copied the column and used find and replace in BBEdit instead, copying that back in to the Excel column. I could then copy the split timecode columns in the same way, using BBEdit to concatenate them back into the right format. The code came back in to Excel like this:

00:00:15:16

Perfick!

Next was to sort out the text fields. Saving out of Excel as a .txt file, I reimported it but this time used a space character as the field separator. This gave me a start code, an end code and then a word in each column for each line. I had already removed the line breaks earlier in BBEdit. By copying the columns containing the words and pasting into BBEdit I got a tab character between each word. I could then find and replace those for spaces. All looked good, so I copied it back into Excel and put it into a single column.

The last step was to add a column between the two sets of timecode, and the second timecode and the text. In both of these I used find and replace in Excel to write a comma instead of having an empty cell. Easy.

From here I could simply highlight all of the columns and copy the content into BBEdit, where I ran a few final checks to make sure everything was where it should be. The Excel format ensured there were tab marks between timecodes and commas, so I simply saved and used the .stl extension.

This imported into DVD Studio Pro with no problems, although the same file saved with a .txt extension didn’t work. No matter, as long as one format worked that was all I needed. Job done!

The thing to remember here is that if you have got the subtitles in an external text based file you can easily adjust the time codes or move things around. Excel is particularly useful for this kind of work. However, if you type the subtitles directly in to DVD Studio Pro you will have a job manipulating them at any level.

Too late? You already have typed them in to DVDSP? OK – it’s not dreadful. Export an item description for the track and use the nifty ‘Subtitler’ app from version tracker to import your file. You can then export a valid .stl file from there and save that for future use.

Single Category RSS feed in WordPress

rssiconSo now having installed WordPress, it turns out that it is infinitely customisable! Oh joy… more to learn about!

The task was to be able to build a single category RSS feed that people can subscribe to if they so chose, rather than have to subscribe to all categories, or all comments. In the theme I am using the sidebar holds the category list and it was here that the code had to go.

The issue was to find the category ID and the category name and only show the link to the RSS *if* the user had opted to view all posts in a single category.

It turns out that WordPress has done most of the hard work for us, in that the functions to get the ID and name are already created. All that had to happen was to find those arguments, wrap them in an ‘If’ tag and post them to the sidebar. Once again, some gentle reading of the Woprdpress documentation got me half way there and able to manually write the code for each category… but it needed automating. And once more, Alex Blanc stepped up to the plate…

To cut a very long story short, here’s the code, entered as a list item in the sidebar.php file for the theme:

<?php if (get_query_var('cat')) { ?>
<li>
<a xhref="/wp-rss2.php?cat=<?php echo get_query_var('cat'); ?>"><?php echo single_cat_title(); ?> (RSS)</a>
</li>
<?php } ?>

This then writes the title of the category in the sidebar as an RSS link, and ensures that only that category’s posts are included in that particular feed. You can see from the code that the link is using RSS2, so you can probably amend this to be any other flavour of feed that you wish.