User sees a beautiful instrument in a corner in a public place. A sign with a QR-code invites them to a web page and to play the instrument using their mobile phone. An image of chimes appears.
User sweeps over the image, mimicing how chimes are played by dragging one's finger through the row of tiny metal bars. The page records the pattern and sends it to the Cimini, which replicates the movement, making the chimes sound. User smiles. Everybody nearby smiles. Everybody takes turns in creating some beautiful ambient music just using their phone..
Cimini in action
Basic concepts explored- People operating public IoT devices by using their own smartphones with just a web page as the interface, not having to download anything.
- Record touch screen events on a smart device through Javascript.
- Send a huge block of coordinates from the touch screen device to a MySQL database on a web site
- Have the Arduino MKR WiFi 1010 (hereafter referred to as 1010) read the database on the web site and control the robot arm operating the chimes accordingly
- Tuning 30 copper tube bars into a 15 tone chromatic range (2 bars per tone) of beautifully sounding chimes
- Studying how people react to this kind of publically playable instrument
Chimes are an instrument belonging to a percussionist's set of sound effect kind of instruments. It consists of a lot of tiny metal bars hanging from a wooden bar. Dragging one's finger through the row of bars makes them hit each other. The sound could be described as glass scattering in a good way.
The Cimini is simply a chimes instrument controlled by a robot. Instead of solid metal bars, the Cimini has pieces of 10 mm chrome plated copper tube.
Perché il nome?Well, I tried to make it Italian, while still keeping the English. So chime became cime (chee-meh). And a small chime would be cimino, si? And since chimes is plural, so is Cimini. Ecco!
The tuning processI cut one test piece from the chrome plated copper tube I'll be using. The length of the piece is 164 mm. I drilled a hole at 22.4% of the total length and hung the piece from that point. The frequency of the piece was 1658.2 Hz. The relation between length and frequency is as follows:
𝑙 = √(K/f)
𝑙 is the length of the tube piece, f is the frequency. K is a constant, which can be calculated from the density of the material of the tube and its inner and outer diameter. But K can also be calculated if we measure the frequency and length. All tube pieces will be of same material and same inner and outer diameter.
So with a 164 mm piece and 1658.2 Hz, we get a value for K about 44598000.
Using a tuning based on A4 = 442 Hz (concert pitch), I thought of having 30 pieces ranging from A♭6 to B♭7, that's 2 bars per tone. That's from 1669 Hz to 3746 Hz. Each tone is ¹²√2 times higher than the previous. After 12 steps we have doubled the frequency. That's in a nutshell the principle of equal temperament, the most used tuning system in Western music.
The 12 steps, which take you up one octave, or to the doubled frequency, are actually called half steps. If you want to go up say 7 half steps from a frequency, you multiply the frequency by 2 to the power of 7/12. Or (¹²√2)⁷. If you go the other way, if you have two frequencies, f₁ and f₂, and want to know the number of half steps, the equations go as follows:
(¹²√2)ˣ = f₁ / f₂x * ln (¹²√2) = ln (f₁ / f₂)x = ln (f₁ / f₂) / ln (¹²√2)
You end up in x having an integer part and a decimal part. If the decimal part is zero, the two tones are in tune wich each other (the integer part is the number of half steps). But they might still be out of the standard A4 = 442 Hz tuning, so check the frequencies with 442 Hz, too (if 442 Hz is your concert pitch).
My test piece happened to be 164 mm with a frequency of 1658.2 Hz. This will be my lowest note, if I just tune it up to 1669 Hz. That means filing some 0.5 mm off the bar (well, an electronic tuner is better than a high precision caliper at this point). The list of bars would be as follows:
Tone Frequency (Hz) Length (mm) Hole at 22.4% (mm)
==== ========= ====== =============
Ab6 1 668.77 163.5 36.6
A6 1 768.00 158.8 35.6
Bb6 1 873.13 154.3 34.6
B6 1 984.51 149.9 33.6
C7 2 102.52 145.6 32.6
C#7 2 227.54 141.5 31.7
D7 2 360.00 137.5 30.8
D#7 2 500.33 133.6 29.9
E7 2 649.01 129.8 29.1
F7 2 806.53 126.1 28.2
F#7 2 973.41 122.5 27.4
G7 3 150.22 119.0 26.7
Ab7 3 337.54 115.6 25.9
A7 3 536.00 112.3 25.2
Bb7 3 746.26 109.1 24.4
Orchestral chimes may have other tunings, they might have tones not belonging to the Western music tradition at all, but I decided to go the safe way.
The design of the instrumentThe 30 bars hang in a 150° arc, radius 160 mm. In the center point there's the tilt-pan device, which has an arm attached. The arm should reach to each chime piece. The bars hang about 5 mm apart from each other. If they are too close, they damp each other instead of letting each piece vibrate. If they are too far from each other, they stop hitting each other too soon while still swinging back and forth.
As mentioned before, each bar should have the hole drilled at 22.4% of the total length, a node, which doesn't vibrate when the bar is hit. Orchestral chimes on the market don't have the holes drilled at the critical node, they simply rely on the solid metal bar vibrating strong enough. But I use cheap copper tube and have to optimise everything. The holes should be perpendicular to the row of bars, to let the pieces freely hit each other while swinging. Or in this case, when the bars form a semi circle, the hole direction should be radial. The length of the supporting thread should be short enough not to steal the kinetic energy from the swinging bars. I'm aiming for having each bar hang about 5 mm from the ceiling plate. But the arm of the tilt-pan device must still reach to each chime, which might lead to the shortest pieces hanging a bit lower. So it's about considering a lot of things, when doing the design.
The actual arc of the hanging bars will be 150°. This will give 15° of free space at each side for the arm to operate. At this point I checked that my horizontal servo actually does 180°. It goes even a bit beyond that. The bars will hang from a rectangular plate like this (top-down view):
The thick black arc radius is 160 mm. My servo has enough torque to drag through the bars at that radius. 150° with a radius of 160 mm gives an arc length of 419 mm, or 5.17° and 14.4 mm per bar. Each bar is 10 mm, so there's some 4 mm space between them, when hanging in rest. I hope it is enough for the sustaining sound, when the swinging has diminished so much that they don't hit each other anymore.
No protractor, no compassThe radius of the bar arc is 160 mm. Each bar hangs in a string, which needs two holes in the rectangular ceiling plate. The holes form their own arcs at radii at 150 mm and 170 mm (the bar diameter is 10 mm and the supporting string hangs from holes 20 mm apart from each other). These holes I'm going to mark in the plate by using just a ruler. The school example in geometry would be to use a protractor, a compass and a ruler, but I thought a ruler and some trigonometry will do. I will mark spots along the side of the ceiling plate. A line from the center to the spot will show where the drill holes are to be made. The distance from the center to the left edge is 165 mm. The distance from the upper left corner (in the image) is 175 mm. The first spot is at 15°. Its distance from the upper left corner is hence 175 mm - 165 mm * tan(15°). In my case, I can place seven bars, marking the spots along the left side. And of course seven bars will be placed symmetrically at the right side. The rest of the bars (16 bars) get their points along the top side in a similar way. Mind that for this project I have just used pieces of wood and plywood I happened to have lying around. If you want to replicate this project, I advise you to use your own materials and recalculate everything. But if you want to use my measurements (including finding chrome plated copper tube of 10 mm), here are the measurements of the markings along the sides of the ceiling plate:
Bar degr mm from upper left corner
=== ==== =========================
1 15.0 130.8 along the left side
2 20.2 114.4 along the left side
3 25.3 96.8 along the left side
4 30.5 77.7 along the left side
5 35.7 56.5 along the left side
6 40.9 32.3 along the left side
7 46.0 3.9 along the left side
8 51.2 24.3 along the top side
9 56.4 48.6 along the top side
10 61.6 70.2 along the top side
11 66.7 89.7 along the top side
12 71.9 107.8 along the top side
13 77.1 124.8 along the top side
14 82.2 141.2 along the top side
15 87.4 157.1 along the top side
16 92.6 172.9 along the top side
17 97.8 188.8 along the top side
18 102.9 205.2 along the top side
19 108.1 222.2 along the top side
20 113.3 240.3 along the top side
21 118.4 259.8 along the top side
22 123.6 281.4 along the top side
23 128.8 305.7 along the top side
24 134.0 3.9 from upper right corner along the right side
25 139.1 32.3 from upper right corner along the right side
26 144.3 56.5 from upper right corner along the right side
27 149.5 77.7 from upper right corner along the right side
28 154.7 96.8 from upper right corner along the right side
29 159.8 114.4 from upper right corner along the right side
30 165.0 130.8 from upper right corner along the right side
The center is at 165 mm from the left side and 50 mm from the bottom side. Mark this center point with a pencil, mark all the 30 points along the sides, place your ruler with zero at the center point and at each of the 30 points, mark the places for the holes for the supporting string at 150 mm and 170 mm. No need to draw lines, which you would later want to rub out anyhow. I actually used a sheet of paper (A4) and made marks at the long side at 0 mm, 150 mm and 170 mm, then I used the sheet as a ruler.
For the supporting thread I'm using thin copper wire. I'm hoping to catch some of the vibrations to transfer to the ceiling plate. If nylon or cotton thread is used, my guess is that more vibration energy would dissipate in the thread itself.
The robot and the armWhen you play chimes by dragging your finger through them, you realize it's a delicate movement. You would need at least four degrees of freedom to replicate it with a robot. You move your finger in three dimensions, not two. You twist your finger, adjusting how the chimes nicely fall off the tip of your finger.
My robot, the pan-tilt module, has only two degrees of freedom. I could use a more advanced robot module, but then again, the user interface is just a 2D image surface on the smartphone, where the user drags their finger in two dimensions. The robot will therefore touch the hanging chimes with a spheric object, allowing the chimes glide off the object smoothly, no matter what the movement direction is. In my tests, the ideal spheric object appeared to be a table tennis ball! It weighs almost nothing and its friction against the chimes is almost none.
The pan-tilt module is placed so that the pan movement axis is exactly at the centre of the arc of chimes. The height of the arm has to be at the point, where the arm reaches the middle point of the chimes, when the arm is horizontal. The arm must be able to tilt both down and up from that horizontal position. This means that when the tilt-pan module is in its lowest tilt position (kind of its horizontal level), the arm must point down, to reach a point below the longest chime!
I re-used the black plastic foam piece (8 mm thick), that protected the pins of the 1010. The pan-tilt is glued onto the plastic foam piece, which is glued onto the white piedestal, raising the vertical tilt part axis to a level just about the middle point of the row of chimes. No screws are used for attaching the pan-tilt device to the piedestal. This prevents vibrations from creating unwanted noisy resonances in the wooden parts.
The softwareThe user browses to the site (johanhalmen.xyz/cimini) and gets this image:
The html page (index.html) that shows this image, has a javascript section that records touch events (start, move and end events), their coordinates and timestamps. Each swipe creates a long list of data, which is sent to a PHP script (receive.php), which saves the list in a MySQL database. Each swipe will have its own ID number. After the first swipe, the static image is replaced by a dynamic one showing the path of the last swipe:
The 1010 runs its own scetch (cimino.cpp), which calls another PHP script (fetch.php), which fetches the data of the oldest (smallest ID number) swipe in the database. After being read, the particular swipe data gets erased from the database. The script outputs the data in a readable form (for debugging purposes, needs the 1010 to be connected to a computer). The 1010 parses the output and starts performing it. The user may start the swipe at any point in the image, but the robot arm must start the swipe from a rest position, which is below the middle point of the arc of chimes. The arm starts from this position, then, in a slow pace, moves first horizontally, then vertically to the starting point of the swipe. After the swipe, the arm moves down, then returns to the rest position and continues reading the fetch.php script.
The databaseI have a website on Hostinger.com that holds the html page and the PHP scripts as well as the MySQL database for the swipe data. The database contains one single table, "coords", that holds the data. The structure of the table is shown here:
One instance in the table is one touch event. One swipe creates hundreds of touch events.
ndx is a unique number for each added touch event. Since the swipes are deleted from the table after being read, the table might become empty, if no new swipes are added. In that case the numbering starts again from 0. This data field serves two purposes. One is for including a key field in the table (may or may not be required), one is for enabling sorting of the events (again, may or may not be required).id is a number identifying which swipe the event belongs to.x, y are the coordinates of the touch event.timestamp is the time in milliseconds for the touch event, always starting at 0 for each new swipe.
Calibrating the movementsThe image in the user interface is just a simple image of chimes. The chimes in my Cimini have slightly different dimensions. But it's important that each significant point in the image corresponds to the same point in the Cimini. If I swipe my finger along the bottom end of the chimes in the image, the arm should touch the botom ends of the chimes in the Cimini. If I swipe my finger to the left or the right end without touching the chimes, the arm should act similarily.
BOM- Arduino MKR WiFi 101027 $
- Pan-tilt device with servos20 $
- Wood parts, paint, glue, screws...0 $ - 10 $ (depending on what you have, what you have to get)
- Chrome plated copper tube40 $
- Copper thread3 $
- Ornaments15 $ - 30 $
Additional costs for tools you might need to buy and web hosting services.
Some further ideas and developmentWhen I lift the instrument ad move it around, the chimes start to swing and make a very beautiful sound. When the arm plays the chimes, I don't always get the same effect. My next build will have a small detail, which hopefully will add to the swing motion. Each of the four poles supporting the ceiling plate, will have a slightly rounded top, a cylindrical (or conical) surface with the axis pointing to the centre of the arc of chimes. This surface would be in both ends. This will allow the pole to slightly sway, making the ceiling plate twist back and forth, prolonging the swinging of the chimes. The screws or bolts in both ends of the poles would have rubber washers allowing the swaying, while still keeping everything steady enough. Every extra swing energy will hopefully go to the chimes swinging in the right direction, hitting each other.
The Cimini is complete as it is in this demonstration. But it has "hand made" written all over it! And as such, it is not ready for mass production. Each detail needs development. All software needs polishing and needs to be written in a generic style, easy to be changed by any user wanting to adapt it to their purposes. All hardware, both material and sizes, needs to be adapted to available items at stores.
The software
The concept of having the user just use their phone browser and not downloading any app, not logging into any special network, means ease for the user and more work for the owner of the Cimini. The owner must put up the web service on a site allowing PHP scripts and MySQL. To make it easier for the owner, the whole concept has to be re-designed. The user could have direct contact between the phone and the 1010.
Also, more details should be included in the user interface, where the user would have to enter some codes to allow access, and the owner could administrate the usage through an admin page.
The wooden parts
The bottom plate, as well as the ceiling plate could be ordered from the local wood supplyer, as ready cut plywood. The round corner poles could be of same measure as the piedestal that the pan-tilt device stands on, some standard measured material (either round or rectangular) that one could cut easily in desired lengths.
The ceiling plate needs the holes for the string holding the chimes. If the plate is cut with a CNC machine (laser or milling), the same machine could be programmed to make the holes.
The pan-tilt device and the arm
The pan-tilt device, the arm and the tip touching the chimes should need further development. It should be 3D printed so that the top most element would have the tilt axis (attached to the servo), the arm and the tip touching the chimes integrated in one print.
And while we're 3D printing, the front façade decorations could be designed and printed in various styles - barocque, classic, art-nouveau...
The chimes
The chrome plated copper tube really has a heavenly sound and there's no need to replace it. But to speed up the process of cutting the pieces, one would need a miter saw capable of cutting the copper tube at a 0.1 mm precision, as well as a pillar drill. The pieces still need to be tuned by hand, but the less one has to file off to get the right frequency, the faster the job will get done. The thread needs to be "sewed" in place by hand, but it would help to have a wooden arc placed between the ceiling plate and the chimes to get the right distance for each chime. This arc could as well be 3D printed.
The electronics
The servos definitely need to be chosen to be as silent as possible. Just for the case of elegancy, the 1010 should have a 3D printed case of its own, with just the micro USB contact sticking out. The whole system could therefore still be powered with a simple power bank or a phone charger attached to the wall.
To cut expenses, further development should be done to replace the Arduino (which really is just an evaluation board) with just the minimum of components soldered to a PCB.
A final product
So you would like to buy a Cimini to place it in your café, to let your customers enjoy playing with it. You would receive a package with all the parts. The bottom plate would have the legs attached, as well as the microcontroller in its own case. You would attach the pan-tilt arm to its place on the bottom plate with a bolt and a wing nut from the bottom. The four poles would likewise attach to their places with bolts and wing nuts. Then you place the ceiling plate with all chimes readily attached in their threads, onto the four poles. The plate has guiding pegs and the poles have holes for the pegs. Finally you snap on the 3D printed decoration, which locks on to the front side of the ceiling plate.
You connect a 5 V USB phone charger to the microcontroller underneath the bottom plate and you are ready to go. Just wait for the network to show up on your list of wireless networks on your phone and browse to the control page. Or choose the longer route, reprogram the 1010 to use a website on internet, to make it easier for anyone to operate the Cimini.
Comments