In­tro­duc­ing MidiI­den­ti­fier

An el­e­gant MIDI piano takes on an ex­tra di­men­sion with the abil­ity to guess the mu­sic you’re at­tempt­ing to play

Linux User & Developer - - Contents -

By hook­ing up a MIDI key­board to a Pi, An­dreas Scholz and karsten Schick created a piano that at­tempts to guess what you’re play­ing…

The two Ger­man mak­ers be­hind the MidiI­den­ti­fier are an in­ter­est­ing but unas­sum­ing pair that seem largely un­aware of how good their lit­tle tin­ker­ing project is. The MidiI­den­ti­fier seems to be the first that they have pub­li­cised, which is sur­pris­ing given the qual­ity of the work; it was largely built out of a love of the old Ap­ple II com­puter de­sign and the de­sire to do some­thing clever but sim­ple with mu­sic recog­ni­tion.

This is such a stylish project – what in­spired you to build it?

Thanks! We are both com­puter sci­en­tists. This some­times makes it dif­fi­cult for our fam­ily and friends to un­der­stand what we are ac­tu­ally do­ing. With this project, we wanted to build some­thing that can be eas­ily grasped (in a lit­eral sense) and that we could show to our friends as well. It was also im­por­tant for us to cre­ate some­thing oth­ers could in­ter­act with in a fun and cre­ative way, and we feel that mu­sic en­ables them to do just that.

What made you de­cide to use the Rasp­berry Pi?

We didn’t re­ally think about it – it seemed the ob­vi­ous choice at that mo­ment. We knew we needed a com­puter that could be con­nected to a piano, a touch­screen and an ex­ter­nal sound­card, as well as run the code. To­gether with its small-form fac­tor, this made the Rasp­berry Pi the ob­vi­ous choice for us.

What cod­ing or li­braries were in­volved in the project? Our cod­ing was done mainly in Python 3 along with a num­ber of shell scripts. We made use of a va­ri­ety of Python li­braries in­clud­ing pygame for au­dio pro­cess­ing, tk­in­ter for the user in­ter­face, mido to deal with the MIDI file for­mat and the flu­idsynth syn­the­sizer for out­put.

How does the mu­sic iden­ti­fi­ca­tion as­pect of the project ac­tu­ally work? The MIDI for­mat is ac­tu­ally quite com­plex – too com­plex for our pur­poses. So for our first step, we im­ple­mented a mech­a­nism to con­vert the MIDI in­put from the piano – as well as all the MIDI files in our li­brary – into a simpler for­mat. On the ba­sis of this for­mat, we ex­per­i­mented with dif­fer­ent al­go­rithms to get as best a match­ing as pos­si­ble while still be­ing as for­giv­ing to faulty in­put (wrong notes, oc­tave and tim­ing and so on) as pos­si­ble. This was ac­tu­ally a very fun part of the project. It en­abled us to be cre­ative with al­go­rithms and laugh in dis­be­lief at how badly some of them worked.

Can you ex­plain how you made the case?

We drew our in­spi­ra­tion for the case from the Ap­ple II com­puter. Af­ter some pa­per pro­to­types and a very am­a­teur­ish tech­ni­cal draw­ing, we used Adobe Il­lus­tra­tor to digi­tise the sketches. To gen­er­ate the joints for the in­di­vid­ual parts, we used a won­der­ful on­line tool called Join­ery (https://clementzheng.github. io/join­ery). Fi­nally, we used a laser cut­ter to cut 3mm ply­wood and put ev­ery­thing to­gether.

Would you do any­thing dif­fer­ently now? What ad­vice can you give to some­one at­tempt­ing your project?

We would prob­a­bly start de­vel­op­ing on Rasp­bian right from the start. Ini­tially, we de­vel­oped the Python code on Win­dows, ex­pect­ing for it to work the same way on a Linux sys­tem due to the gen­er­ally very good cross­plat­form com­pat­i­bil­ity of Python. How­ever, it turned out that Rasp­bian and Win­dows dif­fer fun­da­men­tally in how they deal with MIDI sounds. That took a lot of time to fig­ure out. As for recre­at­ing our project, don’t be afraid of di­verg­ing from our write-up. In the end, there will al­ways be some­thing you en­counter that we didn’t. Just go with the flow and solve the prob­lems.

We ex­per­i­mented with dif­fer­ent al­go­rithms to get as best a match­ing as pos­si­ble while still be­ing as for­giv­ing to faulty in­put

What was the most chal­leng­ing part of the project? Get­ting MIDI files as well as in­di­vid­ual notes to play cor­rectly on the Rasp­berry Pi via the ex­ter­nal sound­card. This sounds easy enough, but Rasp­bian did put some ob­sta­cles in our way there. The dif­fer­ent be­hav­iour on Win­dows and Linux com­pli­cated the mat­ter even more.

What do you have in mind for your next project? An­other mu­si­cal project?

[KS] I don’t have any­thing par­tic­u­lar in mind, but I am in­ter­ested in home au­to­ma­tion and con­sider pur­su­ing a project in that area.

[AS] Not a mu­si­cal project, but I have an idea for an in­ter­ac­tive art project I’ve been want­ing to build for some time now. Stay tuned.

Newspapers in English

Newspapers from UK

© PressReader. All rights reserved.