Wednesday, December 4, 2013

How to build 64 keys MIDI keyboard

Hi folks.... Been a long time since I've promised to write a post on how to build 64 keys midi keyboard. In fact this post will be on what needs to be done to extend the original post where we built midi keyboard from 32 key piano toy. In this case, of course, you will require a toy with more keys... I have not seen much of the toy pianos with 64 keys (have you?) but I guess you could build a matrix from scratch yourself using push buttons (that is fun!)

Monday, October 28, 2013

Hello RPG... Or writing an RPG game template using Scala, Playframework, Akka, Websockets, Crafty...

After playing with Typesafe Activator I've spotted interesting template: reactive-stocks. The template simulates live data feed of stock prices and allows to look up market sentiments (buy/hold) via RESTful search requests to Twitter and lexical analysis service. It demonstrates several interesting frameworks / techniques. It uses Play-framework / Akka asynchronous and features / Websockets data streaming and browser client backed with JQuery.

After some consideration I thought it would be quite interesting as a project to write a small multiplier RPG game that would also make use of all above cool things:

1) Websockets for realtime communication
2) Akka: Model World / Scenes / Users as Akka actors.
3) Playframework to run the show...
4) JQuery / JSon / HTML at client browser

I also needed of course to have a client side Game engine that would allow me to concentrate on actual game implementation and handle rest of the stuff as Sprites, Animations, Collisions, Sound... And after some research I've found Carfty.

5) So Crafty it was...

I would not be discussing the advantages of technologies but will try to explain how I've used every of those technologies. Obviously some of the components were used more and some less. But all were necessary to put this thing together.

Sunday, October 27, 2013

Typesafe Activator - Get to know cool stuff quick...

I've recently gave a short intro to Typesafe Activator at Sydney JVM community meetup

Motivation for the talk was my personal experience with Activator and how helpful it was when I wanted to dive into trying Play framework, Akka and other related technologies...

The reason it was helpful to me was very simple - learning new things needs time and good intro / kick start that will get you going...So here it was a kick starter - Activator that promised quick introduction to technologies like Akka, Playframework for Scala and Java devs.

Using it as simple as getting to downloading the application and executing it.

Infinite monkey theorem... Or could it be really done in a lifetime?...

Hi there... Had a chat with colleagues over coffee and somehow we got to discuss the Infinite monkey theorem.

So I've introduced the subject and explained in my own words that if ridiculous number of monkeys over ridiculous time were banging the typewriter in a quite random manner they would reproduce complete works of Shakespeare. In the context ridiculous numbers are large but finite.

We of course would not witness such a great historical moment but it is possible and possible just because of other "similar" events happened in the past. For example DNA/RNA molecules somehow been composed out of atoms into complex sequence that facilitates reproducible life. Number takes to describe the probability of life randomly creating itself is extremely large as well. Human DNA if converted to bits and bytes will occupy about 1.5 CDs - compact but efficient. This is definitely sufficient to store Shakespeare sonnets (some one already done it by the way). And two can be compared - sonnets of a great poet to a poetry of live... Both are hardly random things......?

But enough philosophy. Let's just talk about monkeys that I am certainly closer to (as every human DNA is in 99% matches DNA of a Chimpanzee... even yours dear reader)...

Friday, August 23, 2013

Enabling USB on Arduino MIDI Keyboard

Considering all modern MIDI controllers have ability to communicate via USB you might think it will be quite nice to connect MIDI keyboard we built directly to USB port on your PC? That’s exactly what we are going to do. Below are the end-to-end steps I took to make it work. It might help someone? May be you?

This instructions were tested on Arduino UNO and should work with Arduino MEGA (not tested, please let me know if you managed to make it work?)
To achieve this we are going to use HIDUINO firmware that makes Arduino UNO board to appear as USB HID (MIDI) device.

Tuesday, July 2, 2013

Shared mutable, Isolated mutable and Immutable state in Concurrency explained by "Russians drinking vodka" analogy...

Actually I got tired of this stereotype of all Russians equating to Vodka drinkers, Babushkas, Izbushkas, and Ivans... This is ridiculous but having said that after reading a book on concurrency and going through some examples I found myself thinking about explaining different types of concurrency designs on example of several Russians drinking a bottle of vodka... And the fact that I have Russian background gives me a right to think about it and share with you. No, I ain't no racist! :( At the same time you could think whatever is dear to you ... say French having a bottle of Champagne... or Germans having a threesome... Bad for me I am not a German. :)))...

In this analogy we will make following association:

  • A number of Russian guys to number of threads performing a task
  • A task is to consume vodka 
  • A resources is a bottle of vodka

Thursday, April 25, 2013

If you trying to setup JSF2 + IceFaces + Hibernate + Spring in Maven2 pom…

If you trying to setup JSF2 + IceFaces + Hibernate + Spring in Maven2 pom you are risking of loosing so much time if you do it from scratch… Trust me I did until I came across this great post. This blog has archetypes prepared for different flavors of libraries which is a great starting point for setting up a new application development.

Have a look and spare yourself from frustration!

Thanks Robert for a superb work!

Thursday, April 18, 2013

Articles must read on using Transactions in Spring

It is very important subject but quite often overlooked by many developers. Some do not have complete understanding and develop software that "works" for years until the issue is finally triggered by some non-trivial scenario. At times issues are silent and when found it is quite difficult (if possible) to fix data as traces of the transactions been lost over time or damage is great...

Monday, January 21, 2013

How to add Velocity sensitivity / Aftertouch to Piano toy midi controller

As promised this is the second part of the project "How to turn Toy piano into Midi keyboard" and in this series we are adding velocity sensitivity to the keyboard. In fact as a bonus we will add an aftertouch effect as well.