The ROLI Lightpad Block – released in 2016 – is a wireless, multitouch, pressure-sensitive MIDI touchpad device with a backlit display of 15x15 LEDs. The Lightpad has a very tactile and flexible surface that is more ergonomic than a touch screen for applying pressure, plus the new 2017 Lightpad Block M includes small waves on its surface offering a tactile ‘guide’ for your fingers; both of these features offering more precise control and a more satisfying experience compared to similar products.
The BLOCKS Dashboard application allows the Blocks hardware to be fully customized for integration with a number of different DAWs and plugins as well as to allow the hardware to operate as a range of different devices such as XY pads, drum pads, mixers, and even games. However a lesser-known feature of Blocks is that they can be easily programmed and hacked, allowing the 94mm x 94mm touch surface and the 225 LEDs of the Lightpad Block to do exactly what you want. In this tutorial, I’m going to introduce you to how you can go about hacking and developing software for the ROLI Lightpad Block as a complete beginner to software development. It is worth mentioning that all of the other Blocks hardware can also be hacked, as well as being able to program the exact behaviour of multiple Blocks connected together, however this tutorial will just focus on using a single Lightpad Block.
Before we start, here is an example video of what we’ll be making – a simple 8-step monophonic MIDI step-sequencer where pressure is used to set note velocity:
A demonstration of the custom sequencer Lightpad app connected to Ableton Live
There are two options when it comes to developing software for the ROLI Blocks:
The first option involves using the Blocks C++ programming language SDK (software development kit) which is most useful when used as part of the JUCE framework, and comes with a couple of example applications. While the Blocks SDK and JUCE framework provide you with the most options for developing custom software, they require third-party IDE (Integrated Development Environment) software to use and therefore may be a bit daunting if you’re new to the world of software development and coding.
The second option involves using a simple programming language - developed specifically for Blocks - called Littlefoot, which provides basic functions for controlling all aspects of the Blocks hardware – all without relying on an external computer application. Possibly the biggest advantage of this option is that it is all done using ROLI’s own BLOCKS Code application, making it a lot easier and less daunting for coding beginners.
Due to the simplicity of the second option, this tutorial is going to focus on using Littlefoot and the BLOCKS Code software for developing Blocks software, turning a Lightpad Block into custom standalone MIDI controller. However if you’d like to explore the other option please see the ROLI Developer webpage.
The Littlefoot programming language provides basic functions for controlling the Lightpad’s LED grid, customizing touch and button interactions, sending and receiving MIDI messages, and supporting multiple interconnected devices. There are a large number of Littlefoot functions that are all documented here, however below I’ve briefly described a number of the most common functions you may use in your Littlefoot scripts, to give you an idea of the different types of things you can program a Lightpad Block to do:
For more information on using the Littlefoot language, see here.
BLOCKS Code is ROLI’s new Littlefoot code editor & compiler for the Blocks hardware, and it provides you with everything you need to develop and upload custom apps to your Blocks.
The simple interface of the app comprises of the following sections:
One very useful feature of BLOCKS Code is that it can automatically compile your code (turn your code into an app) and upload the app to the Blocks hardware as you make changes - creating a seamless development process - however this can be turned off from the ‘Compiler’ menu if desired.
Once you have installed BLOCKS Code onto your computer, complete the following steps:
1. Connect your Lightpad Block to your computer via USB, and press the ‘on’ button to turn it on.
2. Launch the BLOCKS Code application.
3. Check that you can see your Lightpad in the list of devices within the ‘Targets’ section of the application and that the ‘Interact’ and ‘Target’ options are ticked. If you Block is not appearing, make sure BLOCKS Dashboard isn’t running.
4. In the ‘Compiler’ menu make sure that ‘Auto Compile’ and ‘Auto Upload’ are ticked.
5. Go to ‘File -> New File’. This will create a ‘New/Unsaved File’ file within the ‘Projects’ section.
6. Copy the code from this text file into the text editor. The code should then be automatically compiled and uploaded to you Lightpad Block - resulting in ‘No errors’ displayed under the text editor, and your Lightpad now displaying the sequencer app’s default interface. If not, check you copied over the entire code.
To see a description of the code to understand how it is working, see the comments (lines beginning with ‘//’ or sections enclosed in ‘/* */’) within the code. To see more examples of Littlefoot scripts see here.
Once the custom app is uploaded onto your Lightpad, it is ready to be used. Open up your DAW or MIDI instrument and connect to the ‘Lightpad BLOCK’ MIDI device. I have programmed the app to work and be used in the following way:
The final thing you may want to do is allow you custom Lightpad App to appear in BLOCKS Dashboard for easy access. This just requires saving your Littlefoot script into a certain location on your computer, and can be done by completing the following steps in BLOCKS Code:
1. Go to ‘File -> Save As…’ (not ‘Save Project As’)
2. Navigate to Documents/ROLI/Littlefoot
3. Give your app a name and save it
If you now close BLOCKS Code and open BLOCKS Dashboard you should see your app appear in the list of apps.
However there are also some elements of the code that have configured how the custom app appears in BLOCKS Dashboard:
So that’s how you can develop your own apps for the ROLI Lightpad Block. The sequencer app we created here may be fairly simple in regards to what the Lightpad Block can do, however hopefully it provides a good introduction to developing software for Blocks so that you can go on to develop more complex, useful, and unique apps.
You can download the source code for this project using this link.