All posts by admin

Visual Studio 2012 and WOWZAPP

I saw the Microsoft WOWZAPP 2012 hackathon event as a real opportunity for Microsoft to engage with developers at grass roots level and convince them that they should spend their time creating apps in VS2012 for the Microsoft Store.  Therefore it was with some excitement that I arrived the other day at my local event.  The coffee and cookies were flowing and the day had a quiet if measured start.  I had been told to come along with my laptop loaded with Windows 8, VS2012 and the examples SDK.  I did this and made sure I didn’t peek at any of the developer resources ahead of the day in order to give myself a one-shot completely immersive experience.  This is it Microsoft – show me what you’ve got.

The WOWZAPP event has its very own W8 app and this can be downloaded and installed via Powershell as it’s not available (slightly surprisingly) through the App Store itself.  The app package then provides an icon on the desktop and some links to resources.  The choice was then up to you how you used these resources to build an app of some kind.  I wanted to write a little HTML5 game so I quickly found the relevant resource and started building.  The resource was fine if hastily assembled and provided good detail and a nice walkthrough of the features of VS2012.  So far so good and within an hour or so I had a working game and could start to play around with.  However I also wanted to see what the examples SDK could show me so I started investigating the C# and C++ samples with a view to getting perspective on other dev techniques.

This is where the WOWZAPP experience starts to get a little thin.  I went back to the WOWZAPP app to try and find some more info and something else to look at in more detail and quickly realise that that is pretty much it.  There is no depth here – a couple of links to marketing and HOWTO websites and you’re on your own for the rest so I resorted to Googling around for tips and tricks for example on how to get my XNA game built and running inside VS2012.  This is something I would normally be doing at home or in the office but somehow I expected something more to be unveiled at the event.  I expected the scales to fall from my eyes and the path to app nirvana to be shown.  I hoped for some tutorials, some walkthroughs, even some linked branded articles from MSDN say that provided clear declarations of expected modes of behaviour and best practice in development for a variety of ‘target apps’.  Yes there was some information on style but more basic information – like for example what VS2012 technology should I pick for which app type might also be good?

As an experienced developer I’m confused and from seeing the selection of apps created on (or prior to) the day I’d say that I’m not the only one.  Simple case solutions work but in VS2012 there is a confusion of technologies crammed under one roof – C# and C++ sit uneasily side by side.  HTML5/Javascript seem a different world.   I’m still not sure how Blend and the XAML world can fit together with the rest.  At times I feel I’ll want to use all of these technologies but as to how they can work together and how this limits my ability to deploy it to a target environment.

 The only way, like so many times before with so many technologies, will be just to try it all out and see what happens.  As soon as I work out the best development model for the app you want to write I’ll be sure to share it.

Microsoft: Putting the User at the Centre

I’ve caught up with some of the Microsoft Build developer conference videos now.  Between the non-jokes about the weather in Seattle being bad but not as bad as it is back East and giving away oodles of hardware to attendees there were some pretty interesting things to come out last week’s meeting.  It was of course an opportunity for Microsoft to show off Window 8 and Windows 8 Phone along with some of the hardware that is available shortly.  A lot has been made of the Microsoft Surface (and touch interfaces in general in Windows 8) and of course WP8 but I think if we can take away something more fundamental about Microsoft from the themes running through this event.

At Build 2012, developers were told they should be excited about Windows 8 and Windows 8 Phone.  Since watching the videos I’ve come away with the idea that developers had better be excited because I believe this generation of software potentially changes everything for the user.  Indeed I’m pretty blown away by the joined up thinking going on in Microsoft land.  What Apple have been hinting at, Microsoft have just said “Screw it, let’s do it”.  Xbox gaming integration, Xbox music (which I love) even Live Tiles are all starting to make sense.  Suddenly I feel like my desktop PC is like an Xbox or like my PS3 – it is a game console with other capabilities.  Except now the sometimes clunky way that games consoles deal with personalisation and network integration is somewhat, hopefully, relegated to the past.

In existing mobile devices we have many apps and platforms providing some form of integration with other services – some of it ok (say iOS Mail for example) and some pretty terrible (too many to mention) – but what is clear is that there has been a lack of systemic thinking by software architects on what constitutes providing a service to the user rather than as a service to another piece of software.  A lack of clear thinking on user bound services has also been compounded by a tentativeness to execute on a totally user-oriented experience.  Microsoft have shortened the pipe between data and user giving less wiggle room, less API elasticity.  This can only be a good thing.  For example I have an iPhone but I’ve not had the need to get involved with iCloud as I don’t have a Mac.  I have Windows iTunes but I still need to plug my iPhone into it to upload my existing music (if I want to avoid buying it again from the Apple store).  Microsoft through Windows 8 is trying to change the linear approach to device management.  Windows 8 wants to better integrate devices that I already own rather than necessarily forcing me to buy new hardware to do cool stuff.  In fact this is where the underlying marketing strategies between the two companies perhaps differ – Apple say you’d better buy the hardware if you want our software to continue to work, Microsoft say you can have some great software which will work on your existing hardware and you can also buy new hardware later if you find it useful.

With Windows 8 and Windows 8 Phone the ability to share my account across devices is implicit.  As Microsoft themselves say – the user is at the heart of the experience – it’s all about personalisation on all your devices but doing this consistently.  While this sounds a lot like they are just paying lip-service to what everyone else has been doing badly already it seems however like they are actually trying to do this thing properly.  The cloud integration is seamless across devices and somewhat surprising – for example I notice I get my file view preferences taken across between W8 PCs without having to specify them on each device.  Of course apps-wise Windows 8 and of course Windows 8 Phone lag far behind and much has been made of the numbers in the various app stores.  What should not be underestimated is the amount of software already there in Windows 8 already doing most of the things you need.  Indeed until you link up your Facebook and your Skype accounts you don’t really understand what Live Tiles are about – but then suddenly you see that the experience is personal, and it’s personal across all devices and I can seriously consider logging into my desktop or my laptop in the same house and now having to worry about having all the documents I need being to hand (if I take advantage of Sky Drive).  I imagine I’ll be thinking twice before renewing my LiveDrive account next time around.

Slow erosion of boundaries between apps and services has been going on for a while but what Microsoft has done has said – ok you want a properly personalised experience on every device?  You can have it.  And not just through Microsoft services – you can have everything in one place and we won’t stop you integrating so the ability to bring Twitter, Facebook, LinkedIn and undoubtedly many others right on to your new look desktop directly without installing anything from a third party.  You don’t need to worry about putting a pretty picture on your desktop because the pictures are everywhere.

Of course one question that pops up is how this level of integration will work when it comes to security.  The paranoia exhibited by all presenters at Build when they were saying “I’d better lock this as it’s my actual device” is probably as much a testament to how much of their lives are on that device (or at least the services to which it interfaces) as it is to corporate sensitivity.  If all of your accounts are at the mercy of your single Windows Live sign-on then you’d better be very careful with whatever devices have access to it – longer term this could have serious implications for security officers everywhere.

Many other questions still remain of course not least over the newly released Windows Phone 8 SDK.  A requirement on using 64 bit hardware only for developing is a shame and there is a lack of clarity on the purpose of the bundled XNA 4.0 among others.  What is clear however is that with Windows 8 and Windows Phone 8 Microsoft have delivered a big bundle of software to play around and have fun.  The results from devs will come in over the next few months to years.  As an enticement there is a stack of engaging hardware to play around with this stuff on.  Putting the user at the centre of the experience is something that only developers can do – Microsoft can only go so far with their intentions – and as the phrase has it, the market ultimately decides.  However I know I can’t wait to get my hands on some proper Windows 8 and Windows 8 Phone hardware to see, and also to try and deliver, the fully integrated experience that people have been waiting for probably since the invention of the Smartphone.  Maybe it won’t be this iteration but by betting this big, Microsoft are getting mighty close.

Software as a Fashion Statement

If you believe some of what you read then the Microsoft hardware and software launches are all about blurring lines. Lines between leisure and business, lines between gaming and working, lines between using a computer and having fun with a gadget. We are being sold a tablet that is touted to be as useful as a laptop, we are being sold a development platform that is somewhat consistent across consumer and business desktops, laptops, tablets and also mobile technology. As technologists we have no idea if any of this will work yet as developers we are enthralled but slightly scared at the consequences of these fundamental changes, as realists we doubt that Microsoft can pull it all off but as historians we we can be sure that things have now changed forever in the consumer electronics marketplace. Gone are the days that we would agonise over the specs and wonder about the longevity of our hardware devices be they desktop, laptop or mobile. We no longer care much for battery life, for upgradeability, for the number of ports it has got, for the extended warranty. We, as computers users, as smartphone users, are now software consumers. As consumers we demand fashionable gadgets that can display our fashionable software fashionably. And once our hardware has died or is too slow we will buy the next one and either transfer all our software or, possibly preferrably, just start from scratch accumulating more software on our new gadget.

Perhaps you’ll give your old gadget to the kids and they will be happy enough with while it can run the fashionable software they want it to run and after that, pass it on. The software creators in this world are vastly outnumbered by the consumers – so if you really want to reach out in this gadget obsessed age – try a little creativity.

Nowadays Everyone is a Developer

I just discovered the Developer Tools in IE8. WHAT THE?! When did things get so complicated? I suppose when browsers got so capable – however goes some way to explaining why people treat the browser like systems in their own right now. And IE8 and I should fancy also Firefox and everything else has a console I can try stuff out on. How weird – I mean for someone who has not had call to write a website by hand in a long time. No wonder web “developers” can exist purely in web land and still make a lot of noise – web land seems to have all the resources to keep people verybusy and make something like a 20k piece of wondercode seem cool enough to make people’s lives a lot easier. Still, all that piece of code appears to be is essentially a vimrc – a rewrite function that subverts the way the engine works. So what is the browser now – a kernel, an engine, a database? Are developers just DBAs, tweaking and poking the engine to do it what they want it to? And does anybody care about all this cleverness if they’re not actually another web developer? I mean we hear about jQuery and HTML5 but the world is still turning the same way and web pages are as shonky and slow and unreliable as they always were. So what gives with me and what gives with the world of the web?

But I can start to feel a fundamental change in my assumptions. Rather than the browser being the add on – the browser is at the centre and everything else floats around that. But Google tried that and it plainly didn’t work for some very good reasons that Berners-Lee said on a mailing list not so long ago which I would only misquote if I could find it. And so I digress into a Friday reverie of simpler times when you could understand what was going on and not everyone thought they were a developer.

Except of course back then everyone told you to read Zen and the Art of the Internet and The Internet Worm and consider those as even more simple times and looked down their noses at poncy C++ developers with their modern ideas.

Another Rabbit Hole

The last few days have involved all sorts of user interface ridiculousness.  WPF, .NET, Java, Swing and Eclipse and then back to .NET and then on to C++ and then back to .NET again.  It’s nice getting on top, underneath, beyond, behind and inside of things sometimes and then it’s also nice to hear something like this announcement and just think – Ok perhaps this is where I should be going now.  Stop running around like a headless Christmas Chicken.

MonoGame is doing what Unity and GameMaker Studio and and Xamarin and all those other platforms are doing – they’re allowing you to target multiple systems (iOS, Android, WP7, XBox etc) with one codebase utilising a clever framework.  What MonoGame does differently though is that it builds on something that is already there and established (i.e. XNA) and it targets all those platforms from pretty much the same codebase (they say) and it’s open source and it intends to stay that way.  The others are going to charge you money to do this – a lot of money.   The paid-for ones have fancier tools but they all essentially do the same thing.

So I now have something new to look at.  After a year of XNA fiddling with Friendlier and having made progress with Android and OpenGL development I feel I can have an objective look at something like MonoGame without feeling that I’m taking the easy way out.  I’m already writing a framework, I should understand their framework.  And this might be a good opportunity for a little decluttering of the projects that have built up over the last year…

Platform Transform

I’ve been burying my head in Brazil – the framework – over the last few weeks.

The first step was taking Friendlier and making it work as an API. Cutting vast blocks of functionality (which forshame resided mainly in one or two huge files) into firstly addressable chunks and then to plump out this component based API with blocks that would equate to finer grained control with subsequent apps.

To whit – I parcelled up the old stuff and kept it working while creating new things that had a cleaner and therefore more reusable interface. The output of this phase of work was a half completed game called Paulo. This is what Christmas Chickens is turning into. A 3D XNA game written using Brazil.

So once I had satisfied myself that the framework was usable I set about moving it immediately on to another platform. Why not finish the game? Well my goals are bigger than ‘just’ writing games and also not limited to one platform. I could just write a game in XNA if I wanted to target that platform. I wanted to see if this framework would translate to another platform – and I didn’t want to wait any longer to test out the theory.

Next stop – Eclipse, Java, Android OpenGLES. Big change from the (yes) cosseted world of Visual Studio and XNA 4.0.

Select java version, install java SDK, get Eclipse (or another IDE), download the Android SDK and virtual device (AVD) manager, then select and download target Android SDKs, integrate the Android and Mercurial plugins for my IDE and fire up a new Android project.

Then on to the OpenGL integration. Subclass the Renderer object and port my existing C# framework into Java. This bit is relatively straightforward as C# and Java share a great deal of syntactic similarities. The larger challenge is working out how much abstraction to keep in Brazil for Java. OpenGL is a lower level API than XNA is therefore the choice is to bind directly with it or introduce some XNA like helper components such as Vector3s and BoundingBoxes. However, so far so good. I have a working Java framework and a working application and I’m able to fire up a virtual Android device and see the app working.

Next steps will be Paulo for Android and then I tackle the next platform. I’m documenting this transformation here and also over on the xyglo site where you can see code examples.

The Cosseted Programmer

It appears we have come to a juncture in information technology where the sheer weight of data is forcing us to draft everybody into the ranks.  Over the years there have been multiple plays to gamify programming – make it cool – make it understandable – rather have people just stare dumbly at that results and prod occasional buttons.  Our limbic system flinching in response to sounds and colourful 3D shapes was previously considered satisfactorily.  Now we are encouraged to buy virtual stuff inside other stuff to make our experience more valuable.  And it works – because unlike pharmaceuticals – these things aren’t licensed and our kids are hooked into them from an early age.


And it’s no longer enough to just consume these goodies – we’re also taught to create.  Creation is cool.  Photos, videos, blogs, apps.  It’s a self perpetuating cycle of creation – no destruction, just additive, endless piling upon piling of bits into bytes into terabytes into hard disks in drawers and burned onto disks and stored away never to be looked at again.  The world may soon fill up soon like the Stross/Doctorow dystopia planned and we’ll be forced into living in the Clouds ourselves or turn the solar system into one big computer.  Our bodies slumped in the corner of our living rooms while the substrates fill up with our souls emancipated by the combined efforts of humanity – from east to west – working together to abstract our lives away from a flawed meatspace.


So there are these guys like Bret and Light table guy and Anonymous Game Framework Guy who probably all live on the West Coast in the sunshine and think purely in terms of web servers, big data, shiny tablets, closed feedback loops and turning everyone into a developer.  And that is all well and good and also sometimes I think like that and the world is all shiny and exciting – but there is somehow a missing element here.  Our thoughts turn to the lack of boredom thanks to smartphones.  The gap between waking and sleeping where we’re not sharing our lives with each other or silently just consuming others thoughts or the thoughts of machines.  How many of those twitter people you’re reading are actual people typing stuff and thinking stuff?   Are we even paying attention enough to pass our own Turing Test?


A lot of effort, direction and money is being spent/burned/created/transferred in order to capture and inspire developers.  To draft a few inferior souls into the wake of conglomerates who have spotted our Achille’s heel and are making us all believers of a doctrine whose only basis is that inaction and not thinking of anything better to do is a good reason to glance down and lose ourselves again in our hand held worlds.  At the same time as these real businesses – ones that provide a service and get a payment for that service – are making a lot of money out of this shuffling around we are held fascinated in the glow of the Gorilla[R] glass.  We are marking time.  This developer for all, creator for all – as I read it this week the ‘democratizing’ of the development landscape – is no such thing.  And despite these tools being wonderful and in their own way addictive (so that one can become addicted to simply learning more development tools) occasionally it’s just nice to sit around and do something worthwhile and with merit rather than worrying about what technology it needs to use in order to attract the most attention.

The Speed of Change

So I’ve been changing my little 3D app into a framework and puzzling over some of the challenges that this in itself throws out.

A framework creates a logical structure over an existing (or missing) structure and provides you a consistent way of thinking about things. This applies not only to applications that might use that framework but also to other technologies you want to integrate on the back end. The advantage of turning an app something into a framework something is that in you’re effort to construct the framework you start to ask yourself what you really want out of the technology. Additionally you might get lucky and turn what you’ve created into something that someone else could use. So by creating a framework you’re abstracting, promoting re-use and thinking carefully about your design – these are all good things.

So what does “a framework” mean?

In the case of an input device framework this means that you can think about how simple interactions with users are to be represented without having to deal with the actual keystrokes, mouse clicks and gestures just yet. So you can define an interface and then worry about the details when you actually come to use it. In the case of the components you want to define in your framework – the targets for these actions – then you can also think about the interfaces they should expose and how best to interoperate with them. Again the technology that the framework operates with will have certain limitations but those are details that you or someone else can worry about later.

So in some ways it’s just a method of procrastination?

It can be if you’re not careful. And as with any form of programming it can be as simple or as complicated as you want it. The challenge is to do this in a way that is meaningful and works for my existing app in one existing technology but with eyes on the future. With my app’s current dependence on XNA (and XNA may have a limited shelf life) I want to ensure that my own framework is going to allow me a method of porting potentially to DX11/C++, WPF/XAML, Android/Java, iOs/Objective C or wherever else I want to go. So I’m investigating these other technologies as I come up with the framework – so it acts as a stepping stone as well as a way of breaking up the work of porting into manageable chunks.

So where does this end up?

A framework may well end up being no use to someone else but it will at least provide you with a stable view of various technologies underneath – a little like a photographer framing a shot with his hands. Your frame of reference is you, rather a moving background with unclear borders. And in case you haven’t noticed technology things are moving pretty fast these days. If you want to get ahead – then get yourself a framework.

C++ (chew slowly)

I spent a some time on the weekend looking at Rosegarden for Windows for the first time in a while.  I’ve been meaning to get the device allocation working correctly with RtMidi and get the MIDI recording also working but it’s slightly more challenging when you have to pass stuff back from it’s own thread rather than having access to all the nice Driver level features we’ve built into Rosegarden.

Rosegarden has the concept of a Studio – originally this was designed around the idea of device templates and the autoload document in Logic Audio – so essentially you can set up your external MIDI and audio devices once and then save it all to your autoload file and every time you hit ‘New Composition’ you get a fresh canvas with all you devices all set up and raring to go.   In my original design I’d also expanded the idea of the Studio to encompass audio placement eventually so that you’d be able to mimic acoustics of virtual instruments and such like – so being able to place MIDI and audio instruments in the stereo (or more) sound field and have consistent effects.  However it just became a layer in the end whereby we could try and put sensible names onto MIDI instruments and provide something approaching a consistent interface across audio and MIDI.   Perhaps in this regard it wasn’t such a good idea simply copying the Logic Audio model because to be honest it wasn’t a very elegant solution – I just didn’t know any better.

Have a look at Albeton if you want to see a way that this can be addressed for recording purposes.

Anyway – I digress – Rosegarden has a Studio concept which is an abstraction of MIDI and Audio devices and I need to tie up my outgoing and incoming MIDI events to the Studio model if I’m to make Rosegarden understand what the events are and where they come from.  So I have to jump through a few hoops to make the MappedStudio (as it’s known at the sequencer level) available to the MidiThread.  At this point I got a great remind of how hokey C++ syntax is – as my RtMidi event callback is a static method I have to declare any data structures that it wants to use also as static.  As I’ve been used to the wonderful world of C# for a long time now I tried to write:

static public MyStructure m_myStructure;

In the class definition.  Forgetting of course that my scope definitions are section based in C++.  Then for the life of me could I remember how to initialise this static public structure in the code and where?  No – first I tried in the header (of course no joy), then in the body but of course I got the naming convention wrong.  Eventually I got my definitions correct after a lot of fiddling and probably some swearing and of course waiting for the rebuilds (don’t forget the linker errors) but it demonstrates to me just why I moved on around 2004 and tried another language or two after being mired in C++ land for a while.  It can all drive you insane and I’m just now thinking that I’ve not even started to think about debugging the undoubted mistakes I’ve made in memory management with the changes I’ve made.

So bear it in mind, C++ is wonderful for connecting across the seemingly impassable chasms of disparate functionality and fixing holes between APIs but it takes a bit of your soul with you every time you lose your temper.  So take small bites, chew slowly and keep topped up with plenty of fluids.  It’s going to get warm and shouty out there.

The Xyglo Framework

Rather than ploughing on with features directly in the Friendlier codebase I’m now in the process of breaking it out into a framework that I can share with others.  This will allow me to get feedback from all you developers and also potentially target multiple platforms – or at least see what I have in common with other platforms and if the same event model is going to work with them.

What with things changing in the Windows world – W8, DX11, perhaps the end of XNA then this for me is a sensible option.  Also I want to shortly have a look at VS2012 and the options available there.

Please as I just tweeted – Kinect for Windows SDK is going to be upversioned shortly and I’m still lagging behind on my framework for that too.   So, back from the summer break, suddenly masses to do to keep up with the rest of the world.

I’m also way overdue on my promise to do some more work on Rosegarden for Windows.  This also needs to be worked into the mix.

All in the all my poor Raspberry Pi doesn’t get a look in!