Less Rock, More Roll: A MIDI Barrel Piano

Strolling around a park, pedestrian zone, or tourist area in any bigger city is rarely complete without encountering the sound of a barrel organ — the perfect instrument if arm stamina and steady rotation speed are your kind of musical skills. Its less-encountered cousin, and predecessor of self-playing pianos, is the barrel piano, which follows the same playing principle: a hand-operated crank rotates a barrel, and either pins located on that barrel, or punched paper rolls encode the strings it should pluck in order to play its programmed song. [gabbapeople] thought optocouplers would be the perfect alternative here, and built a MIDI barrel piano with them.

Keeping the classic, hand-operated wheel-cranking, a 3D-printed gear mechanism rolls a paper sheet over a plexiglas fixture, but instead of having holes punched into it, [gabbapeople]’s piano has simple markings printed on them. Those markings are read by a set of Octoliner modules mounted next to each other, connected to an Arduino. The Octoliner itself has eight pairs of IR LEDs and phototransistors arranged in a row, and is normally used to build line-following robots, so reading note markings is certainly a clever alternative use for it.

Each LED/transistor pair represents a dedicated note, and to prevent false positives from neighboring lines, [gabbapeople] 3D printed little collars to isolate each of the pairs. Once the signals are read by the Arduino, they’re turned into MIDI messages to send via USB to a computer running any type of software synthesizer. And if your hands do get tired, you can also crank it with a power drill, as shown in the video after the break, along with a few playback demonstrations.

It’s always fun to see a modern twist added to old-school instruments, especially the ones that aren’t your typical MIDI controllers, like a harp, a full-scale church organ, or of course the magnificently named hurdy-gurdy. And for more of [gabbapeople]’s work, check out his split-flip weather display.

Continue reading “Less Rock, More Roll: A MIDI Barrel Piano”

Ask Hackaday: Are 80 Characters Per Line Still Reasonable In 2020?

Software developers won’t ever run out of subjects to argue and fight about. Some of them can be fundamental to a project — like choice of language or the programming paradigm to begin with. Others seem more of a personal preference at first, but can end up equally fundamental on a bigger scale — like which character to choose for indentation, where to place the curly braces, or how to handle line breaks. Latest when there’s more than one developer collaborating, it’s time to find a common agreement in form of a coding style guide, which might of course require a bit of compromise.

Regardless of taste, the worst decision is having no decision, and even if you don’t agree with a specific detail, it’s usually best to make peace with it for the benefit of uniformly formatted code. In a professional environment, a style guide was ideally worked out collaboratively inside or between teams, and input and opinions of everyone involved were taken into consideration — and if your company doesn’t have one to begin with, the best step to take is probably one towards the exit.

The situation can get a bit more complex in open source projects though, depending on the structure and size of a project. If no official style guide exists, the graceful thing to do is to simply adopt the code base’s current style when contributing to it. But larger projects that are accustomed to a multitude of random contributors will typically have one defined, which was either worked out by the core developers, or declared by its benevolent dictator for life.

In case of the Linux kernel, that’s of course [Linus Torvalds], who has recently shaken up the community with a mailing list response declaring an overly common, often even unwritten rule of code formatting as essentially obsolete: the 80-character line limitation. Considering the notoriety of his rants and crudeness, his response, which was initiated by a line break change in the submitted patch, seems downright diplomatic this time.

[Linus]’ reasoning against a continuing enforcement of 80-char line limits is primarly the fact that screens are simply big enough today to comfortably fit longer lines, even with multiple terminals (or windows) next to each other. As he puts it, the only reason to stick to the limitation is using an actual VT100, which won’t serve much use in kernel development anyway.

Allowing longer lines on the other hand would encourage the use of more verbose variable names and whitespace, which in turn would actually increase readability. Of course, all to a certain extent, and [Linus] obviously doesn’t call for abolishing line breaks altogether. But he has a point; does it really make sense to stick to a decades old, nowadays rather arbitrary-seeming limitation in 2020?

Continue reading “Ask Hackaday: Are 80 Characters Per Line Still Reasonable In 2020?”

Copy And Paste Deemed Insecure

Back when Windows NT was king, Microsoft was able to claim that it met the strict “Orange Book” C2 security certification. The catch? Don’t install networking and remove the floppy drives.  Turns out most of the things you want to do with your computer are the very things that are a security risk. Even copy and paste.

[Michal Benkowki] has a good summary of his research which boils down to the following attack scenario:

  1. Visit a malicious site.
  2. Copy something to the clipboard which allows the site to put in a dangerous payload.
  3. Visit another site with a browser-based visual editor (e.g., Gmail or WordPress)
  4. Paste the clipboard into the editor.

Continue reading “Copy And Paste Deemed Insecure”

One-Percenter Mods For Premium Apple Pencil Usability

At $129 USD, Apple certainly do sell a very expensive “pencil”. Despite the high cost of entry, [Eric] identified several shortcomings and set about solving them himself with a few choice mods.

The first concern is the excessively slippery surface finish, that could lead to the expensive device being dropped and damaged. [Eric] starts by creating a special tool to help handle the pencil during the refinishing process. He highlights how key this is to getting a good final result, without fingerprints or other flaws ruining the finish. With the manipulator ready, the pencil is then given a wipe down with wax and grease remover prior to a dusting of a translucent spray paint. The finish is poor, however, and [Eric] instead elects to try again with a plastic primer first. A series of tinted clear coats are chased with a urethane clear topcoat for a hardy, grippier surface texture.

The final mod concerns the tip. It’s lathed down in a power drill to give a shape more akin to the ballpoint pens [Eric] is used to sketching with. Additionally, the tip is dyed black with a Sharpie marker and a heat gun, to help it contrast better when sketching on a white screen.

These mods may seem trivial to a casual user, but for a designer who draws for a living, usability is key. The striking orange finish is just a bonus. We don’t see too many stylus mods, but with the increased popularity of tablets, we’re sure to see more down the road. If you’ve got one, be sure to drop us a line! Video after the break.

Continue reading “One-Percenter Mods For Premium Apple Pencil Usability”

Justice For The Gatwick Two: The Final Chapter In The British Drone Panic Saga

At the end of 2018, a spate of drone sightings caused the temporary closure of London Gatwick Airport, and set in train a chain of events that were simultaneously baffling and comedic as the authorities struggled to keep up with both events and the ever widening gap in their knowledge of the subject.

One of the more inept actions of the Sussex Police was to respond by arresting the first local drone enthusiast they could find on Facebook, locking up a local couple for 36 hours and creating a media frenzy by announcing the apprehension of the villains before shamefacedly releasing them without charge.

In a final twist to the sorry saga, the couple have sued the force for wrongful arrest and false imprisonment, for which the cops have had to make a £200,000 ($250,117) payout including legal fees.

We reported extensively on the events surrounding the case 18 months ago, and then on a follow-up event at London Heathrow airport. The mass media at the time were full of the official line that drone hobbyists must be at fault, but then as now we were more interested in seeing some hard evidence. As we said then: Show us the drone.

So how has the new drone law progressed, since it was decided that Something Must Be Done? Enthusiasts have continued as before, and the multirotor community is as technically creative as ever. We were fortunate enough to host the Lets Drone Out podcast at MK Makerspace back in those halcyon days before the pandemic and see the state of the art in sub-250g craft, and with those and commercial offerings such as the DJI Mavic Mini all requiring no registration there is increasingly little need for an enthusiast to purchase a larger machine. The boost to the British drone industry we were promised has instead been a boost for the Chinese industry as we predicted, and of course we’re still waiting for the public inquiry into the whole mess. Something tells us Hell will freeze over first.

If you’d like the whole backstory in a convenient and entertaining video format, can we direct you to this talk at CCCamp 2019.

Thanks [Stuart Rogers] for the tip.

Keystone Kops header image: Mack Sennett Studios [Public domain].

Obstacle Avoidance For Drones, Learned From Mosquitoes

Our understanding of the sensory capabilities of animals has a lot of blanks, and often new discoveries serve as inspiration for new technology. Researchers from the University of Leeds and the Royal Veterinary College have found that mosquitos can navigate in complete darkness by detecting the subtle changes in the air flow created when they fly close to obstacles. They then used this knowledge to build a simple but effective sensor for use on drones.

Extremely sensitive receptors at the base of the antennae on mosquitoes’ heads, called the Johnston’s organ, allow them to sense these tiny changes in airflow. Using fluid dynamics simulations based on high speed photography, the researchers found that the largest changes in airflow occur over the mosquito’s head, which means the receptors are in exactly the right place. From their data, scientists predict that mosquitos could possibly detect surfaces at a distance of more than 20 wing lengths. Considering how far 20 arm lengths is for us, that’s pretty impressive. If you can get past the paywall, you can read the full article from the Science journal.

Using their newfound knowledge, the researchers equipped a small drone with probe tubes connected to differential pressure sensors. Using these sensors the drone was able to effectively detect when it got close to the wall or floor, and avoid a collision. The sensors also require very little computational power because it’s only a basic threshold value. Check out the video after the break.

Although this sensing method might not replace ultrasonic or time-of-flight sensors for drones, it does show that there is still a lot we can learn from nature, and that simpler is usually better. We’ve already seen simple insect-inspired navigation for drone swarms, as well as an optical navigation device for humans that works without satellites and only requires a view of the sky. Thanks for the tip [Qes]! Continue reading “Obstacle Avoidance For Drones, Learned From Mosquitoes”

Print-in-Place Helping Hand Grabs A Hold Of Your PCB

We probably don’t have to promote the benefits of a third hand or PCB holders in general, such is their obvious utility. While you can arrange some boxes and pile up tools on your bench to get a similar result, a good grip and flexibility to move the PCB around during soldering or performing any other work on it makes life just so much easier. Thanks to 3D printing there have been plenty of inspiring designs that go beyond the usual clumsy-yet-cheap croc clip version of it, and [SunShine] adds one on to the list with his spring-loaded print-in-place PCB gripper, demonstrated in this video and available on Thingiverse.

The gripping part’s design is based on a spring-loaded box [SunShine] created a little while back — which you can read more about in his Instructable. The holder itself comes in two varieties: one that brings its own stand, and one that has a GoPro mount. The first one is really more to show off the design, and while the gripping part is fully functional, it might not perform too well with heavier boards and easily tip over. Sure, a bigger bottom or mounting it to something more sturdy will fix that, but so will the GoPro-mount version, which also adds the whole flexibility aspect.

If you do prefer something standing more sturdily on your desk though, have a look at the concrete-mounted solder squid from earlier this year. And if you’re interested in more of [SunShine]’s work, check out his 3D-printed brush collection.

Continue reading “Print-in-Place Helping Hand Grabs A Hold Of Your PCB”