Playing it by ear with Piano HAT

Playing it by ear with Piano HAT

Relative pitch is the ability to identify a given musical note by comparing it to a reference note. Unlike perfect pitch, relative pitch can be improved with training. The Piano HAT is a versatile piece of hardware that we can use to create a fun game that tests people’s skill in recognising different notes. It was inspired by Zachary Igielman’s legendary PiPiano and it turns your Pi into a functional musical keyboard. Each of the 16 capacitive keys also has an LED so you can create you own ‘learn to play’ tutorials or just give your performances a visual appeal. You’ll need A Piano HAT The Piano-HAT library Headphones or an external speaker STEP-01 Getting started with Piano HAT Like most HATs, this one is straightforward to use. Simply plug it carefully onto the GPIO pins of your Pi. Then install the Piano-HAT Python library. This requires the I2C bus on the Pi to be enabled, and there are plenty of instructions for this online. But to make life super-easy, those Pirates at Pimoroni provide a handy script that takes care of everything:$ curl -sSL get.pimoroni.com/pianohat | bashSTEP-02 Wired for sound There are two options for getting audio output from a Pi. If you are using a HDMI monitor or a TV that has built-in speakers, the audio can be played over the HDMI cable. If not, you can switch to use headphones or a speaker plugged into the headphone jack. The Pi will normally auto-detect the available outputs, but sometimes it gets this wrong. To force audio to use a specific output, you can use this command:$ amixer cset numid=3 2The second number determines the output: HDMI = 2, jack = 1, auto = 0. STEP-03 Play it again The Piano-HAT library has a nice collection of demonstration Python scripts. A good one to start with lets you use the Piano HAT as… a piano!$ sudo python Pimoroni/pianohat/simple-piano.pyIf you press the Instrument key, you’ll notice that the sounds change from pianos to percussion. The Piano-HAT library itself does not map any of the keys to a particular sound; that is all done using Python. The sounds themselves are WAV files, which are played using the Pygame library. Let’s map our own sound to one of the Piano HAT’s keys. Find a short WAV file online (or create your own using Sonic Pi) and save it as mysound.wav. Then type in the…
Source: Playing it by ear with Piano HAT

Media Pi Plus review

Media Pi Plus review

We all know at least one person who just has a Raspberry Pi for a media centre, running their TV on Kodi or even an ancient version of XBMC that does the job. One of the things that has been lacking from this equation for the longest time is a suitable case for a Pi hooked up to your television – a case that can slip in unnoticed under your TV, next to a Sky+ box and that Wii you haven’t touched in years. The full review can be found in The MagPi 39 While the Media Pi Plus isn’t the first one, or even the first Media Pi product, they’re rare enough to highlight and discuss. In the Media Pi Plus’s case, it’s a re-release to fit the form factor of the Raspberry Pi B+ and the Pi 2. In aesthetic terms, it absolutely looks like something you’d put under your TV, specifically something like a Freeview box: it’s unassuming, black, and with very little branding. There is some construction required with the case, as a Raspberry Pi is not included. Popping the case open, you can see exactly how it works: it extends out and relocates a number of the Raspberry Pi’s ports throughout a largely empty box. While this may seem slightly redundant, it does provide extra power to the USB ports, allowing for hubs to be connected. You can also connect an IR receiver directly to the GPIO ports, which works well with the media remote included, even if you have the ability to turn the Pi off but not on again with it. From the rear you have access to re-arranged Pi-ports It’s really designed to be used with Kodi, which is why our version came with OpenELEC on a pre-formatted SD card, although other Kodi versions and offshoots (we’re looking at you, OSMC) will work just fine. You may need to tweak some of the remote settings, but it will be fine nonetheless. The best thing about the Media Pi Plus is that it’s very cheap. Even if you factor in a Pi 2, it’s just south of £70 for the whole thing, which is pretty great value for a media centre that will reliably serve you 1080p for a long time to come. Construction is a bit tricky and the case can feel a little flimsy, though if you aren’t planning on flinging…
Source: Media Pi Plus review

Pi Spark supercomputer cluster

Pi Spark supercomputer cluster

The Raspberry Pi is great for learning computer science, but there’s one area that’s big news but requires big computers, and that’s ‘big data’. Big data software typically runs on clusters of networked computers, working together to perform the heavy lifting required. This clustered nature makes learning big data tricky, because you need several computers wired together to practise. Sung-Taek Kim, a software engineer from Korea, decided that the Raspberry Pi would be perfectly suited to the task. “Raspberry Pi is a great education platform to learn how big data software works,” he tells us. “It is [comparatively] slow and low-powered, [so] that you would have hands-on experiences when your data manipulation methods execute as planned.” Six Raspberry Pi’s make up the SparkPi In fact, the light performance of the Raspberry Pi becomes an advantage when learning big data techniques. “Once you miss a small detail,” explains Sung-Taek, “you feel the operation processes slow down.” “Sending data across [a] network takes time,” he adds. “All the CPUs in your cluster compete for resources such as memory or disk [space], and a node or two could suddenly refuse to work, just like [in] a Google-class data centre cluster.” He explains that the relative slowness of a Pi cluster is actually an advantage, enabling you to prepare for such events. Sung-Taek’s cluster is based around six Raspberry Pi 2 boards wired together with Ethernet cables via a D-Link 8-port Gigabit Desktop Switch. “Theoretically, you would only need one Raspberry Pi,” says Sung-Taek, “since Spark exploits the [nature] of a master-slave scheme. Prepare a Raspberry Pi as a slave and your laptop as a master. Connect two Raspberry Pi devices and you have a Spark cluster.” Sung-Taek suggests using between three to eight Raspberry Pi boards for the project. “Once you have more than ten Raspberry Pis,” he says, “it’s a headache to find a proper power source, to arrange the network and power cord.” The cluster is made using a custom casing found on the GitHub The hardest part seems to be building the enclosure. Sung-Taek hosts schematics on GitHub, but accuracy is vital. Even a half millimetre offset in the cutting template could render one of the acrylic tiers useless, he warns. Aside from the Raspberry Pi units, the project isn’t expensive. The power supply, network switch, cables, screws, and enclosure only came to around $60. A complete list of materials is available…
Source: Pi Spark supercomputer cluster

Raspberry Pi at the Festival of Code 2015

Raspberry Pi at the Festival of Code 2015

Mighty oaks from little acorns grow – and this applies to both the ethos and rapid growth of Young Rewired State’s annual Festival of Code. What began in 2009 as a weekend gathering of 50 self-taught young coders, aimed at introducing them to the benefits of open data, has since expanded to become the world’s largest annual hack event for young people. Some 1,200 under-18s attended this year’s finale at Birmingham’s ICC (International Convention Centre), showcasing the projects their teams had created over the previous week at one of 66 technology centres, most in the UK, plus a few overseas. So great was the attendance – along with parents, mentors and centre leads – that it took six hours to process them all through ICC registration on the Friday afternoon. The full article can be found in The MagPi 38 “This year it felt like we had finally come of age,” says YRS founder Emma Mulqueeny. “Every year we learn hard lessons! And every year we try to make sure we address those. This year it really seemed like we had managed to work out how to address the issues of scale… The feedback has been incredible and really wonderful to see. The standard of the hacks produced by the teams was also higher than ever.” The even had a lot of kids coding together or on their own. Image by Paul Clarke www.paulclarke.com Infectious enthusiasm The sheer level of enthusiasm is something noted by most attendees, including Raspberry Pi Foundation CEO Philip Colligan, who was on the judging panel for the heats and semi-finals. “The kids are awesome,” he tells us. “Walking around, you can see that they love every minute of it.” He’s also amazed at what the entrants managed to achieve in just a week: “They’re learning new programming languages, how to access and use open data, they’re doing physical hacks and physical computing projects.” Most of all, however, he stresses the importance of the kids solving problems that they care about, which means they’re totally driven to learn what need to create and showcase their project. Fellow judge and Raspberry Pi Foundation colleague Marc Scott was equally impressed. Describing the scene on the Friday evening, as entrants continued to work on their projects, he says: “It’s quite an amazing sight to see that many kids all hunched over laptops, tablets, phones, and Raspberry Pis, with screens…
Source: Raspberry Pi at the Festival of Code 2015