Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 06:49 19 Dec 2025 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : read out carolling christmas bells

     Page 6 of 7    
Author Message
phil99

Guru

Joined: 11/02/2018
Location: Australia
Posts: 2873
Posted: 07:28am 19 Nov 2025
Copy link to clipboard 
Print this post

Here is another player program. I noticed the PLAY SOUND command takes time to get processed, causing the tempo to slow a few mS. This fixes that and also has the PORT output to drive the solenoids.
It also has provision to increase / decrease the solenoid pulse time to suit your new solenoids.
The Port is GP0 to GP11 so sound can be on GP12 and GP13.
' "Glockenspiel player 02.bas"
Dim integer note, BellNote, bells, FZ, track
Dim float BellTime, Bell.prev, t, PulseChange = 0 'Add to, or subtract from pulse duration (mS)
'*******Add your tone sequence here.*************
Dim integer tone(11)=(2695,2401,2139,2019,1906,1799,1602,1513,1428,1348,1200,1070)

For n=0 To 11
 SetPin MM.Info(pinno "GP"+Str$(n)),DOUT
Next

'*******Add your recorded file name here.*************
Open "music.dat" For Input As #1
Print : Print " Track 0 - Bell Test"

Timer = 0

Do
  Input #1, BellTime, BellNote 'get the data
  If BellTime = 0 Then BellTime = 35' + PulseChange '0 not valid so assume a solenoid pulse
  If BellTime < 100 Then Inc BellTime, PulseChange 'adjust solenoid pulse for different solenoid
  If BellTime >= 100 + PulseChange Then Inc BellTime, -PulseChange 'compensate for above to maintain tempo
  t=Timer
  If Not bellnote Then Port(gp0,12) = Bells
  If  bellnote Then Port(gp0,12) = 0
  If Not BellNote Then Play Stop
  Print BellTime, BellNote, Bin$(Port(gp0,12),12),,
  bells=bellnote

  FZ=0
  If BellNote Then
   For note=0 To 11
    If (BellNote>>note) And 1 Then
     Inc FZ
     Play SOUND FZ,B,S,tone(note)
     Print tone(note);"Hz",
    EndIf
   Next
  EndIf
  Print

  If  BellTime > 3000 Then
    Inc track
    Pause 1000
    Play stop
    Print : Print " Track"; track; " ========== Track"; track
  EndIf

 Do : Loop Until Timer-t >= BellTime
Loop Until Eof(#1)

Port(gp0,12) = 0 'ensure solenoids are off
Print : Print "---------- Ende -----------"
End


Footnote added 2025-11-21 07:54 by phil99
A tester for the program above.
'Test PORT output of glockenspiel program using a second Pico.
'connect GP0 to GP11 plus Gnd. to same pins on other Pico

For n=0 To 11
 SetPin MM.Info(pinno "GP"+Str$(n)),Din'OUT
Next

Do
  Print Bin$(Port(GP0,12),12),Port(GP0,12),
  t=Timer:Do :Loop Until Port(GP0,12) : Print Cint(Timer-t)
  Print Bin$(Port(GP0,12),12),Port(GP0,12),
  t=Timer:Do While Port(GP0,12):Loop : Print Cint(Timer-t)
Loop

End


Footnote added 2025-11-24 17:40 by phil99
Hi Frank,
Just in case you get tired of the tracks always playing in the same sequence this program plays all the tracks in a random sequence, except for Track 0 (the Bell Test track) which is always first.
Random Player.zip
The Zip contains the player program and 23 track .DAT files. Copy them all to A: before running the program.
 
Frank N. Furter
Guru

Joined: 28/05/2012
Location: Germany
Posts: 1022
Posted: 06:55pm 19 Nov 2025
Copy link to clipboard 
Print this post

Thank you very much, I bought some aluminum tubing today to experiment with.

Frank
 
Frank N. Furter
Guru

Joined: 28/05/2012
Location: Germany
Posts: 1022
Posted: 02:36pm 23 Nov 2025
Copy link to clipboard 
Print this post

Here is my first (and hopefully only) attempt at making sound tubes:



An initial sound test sounds quite promising:



Frank
 
twofingers

Guru

Joined: 02/06/2014
Location: Germany
Posts: 1704
Posted: 11:02am 27 Nov 2025
Copy link to clipboard 
Print this post

Hi Frank,
this isn't meant as criticism, but I doubt the (wind) chime idea will work. That's because the tubes can't be fixed, and the point of impact  - since the tubes move - isn't constant. I found the xylophone/glockenspiel idea (metal plates) more convincing.
But it's probably too late to change the concept.

Perhaps this is simply due to a linguistic misunderstanding ("glockenspiel")?
Kind regards
Michael
causality ≠ correlation ≠ coincidence
 
phil99

Guru

Joined: 11/02/2018
Location: Australia
Posts: 2873
Posted: 11:29am 27 Nov 2025
Copy link to clipboard 
Print this post

I also wondered about stability but perhaps a triangulated suspension will be sufficiently stable.

For a random player see the second footnote in my last post.
 
Frank N. Furter
Guru

Joined: 28/05/2012
Location: Germany
Posts: 1022
Posted: 08:57pm 27 Nov 2025
Copy link to clipboard 
Print this post

@twofingers:

Michael, that was just a test to see if the tubes sound good together. Metal plates would have been more difficult to manufacture (above all: where would I have gotten the right formulas for calculating the frequencies? ).

@phil99:

It's hard to see in the photos. The suspension points have been calculated and are unfortunately very far towards the center of the pipe. For the longest pipe, it's 76.2 mm. Unfortunately, this makes a triangular suspension very difficult to achieve.


I have found that, surprisingly, the tubes also sound good when they are suspended with bell wire (...is bell wire the correct term???). This allows them to swing in only one direction. I would like to try connecting them all together with a thread. That would then limit the remaining degree of freedom.
Electromagnets have been ordered—I'm curious to see if they are suitable:



Today I bought two MDF boards for the frame...

Frank
 
phil99

Guru

Joined: 11/02/2018
Location: Australia
Posts: 2873
Posted: 09:17pm 27 Nov 2025
Copy link to clipboard 
Print this post

Plan "B"
 
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 5540
Posted: 07:44am 28 Nov 2025
Copy link to clipboard 
Print this post

Frank,

These solenoids seem to have the reverse action. You need to activate them all the time. They may get hot.

Volhout
Edited 2025-11-28 17:46 by Volhout
PicomiteVGA PETSCII ROBOTS
 
Mixtel90

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 8374
Posted: 08:42am 28 Nov 2025
Copy link to clipboard 
Print this post

Depends. I can't see here, but some have a hole at the back where  pin can be fitted in the hole at the back of the armature to make it double-acting. That would be useful here. The threaded end merely holding a cushion pad for the returning armature. Otherwise it's probably a pivoted "hammer" (like a piano) that's needed.
.
Edited 2025-11-28 18:44 by Mixtel90
Mick

Zilog Inside! nascom.info for Nascom & Gemini
Preliminary MMBasic docs & my PCB designs
 
phil99

Guru

Joined: 11/02/2018
Location: Australia
Posts: 2873
Posted: 11:08am 28 Nov 2025
Copy link to clipboard 
Print this post

  Quote  Otherwise it's probably a pivoted "hammer" (like a piano) that's needed.
I thought that sort of thing would be the way to do it too. On page 3 a DIY method.
  Quote  Perhaps automotive relays could be adapted. Glue a flexible arm with a striker on the end to the armature.
 The flexible arm would allow the inertia of the striker to ping the bell without resting on it to avoid dampening the note.
 
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 5540
Posted: 11:15am 28 Nov 2025
Copy link to clipboard 
Print this post

  phil99 said  The flexible arm would allow the inertia of the striker to ping the bell without resting on it to avoid dampening the note.


Yip, that is the way to do it. Then the solenoid timing is not critical anymore. And the kinetic energy in the striker is passed on to the bell, leaving less energy in the striker, so it will not virbrate/resonate against the bell a second time again. But that is an adjustment (also present in door bells (the old-non-electronic).

Volhout
Edited 2025-11-28 21:18 by Volhout
PicomiteVGA PETSCII ROBOTS
 
Frank N. Furter
Guru

Joined: 28/05/2012
Location: Germany
Posts: 1022
Posted: 05:59pm 28 Nov 2025
Copy link to clipboard 
Print this post

  phil99 said  
  Quote  Otherwise it's probably a pivoted "hammer" (like a piano) that's needed.
I thought that sort of thing would be the way to do it too. On page 3 a DIY method.
  Quote  Perhaps automotive relays could be adapted. Glue a flexible arm with a striker on the end to the armature.
 The flexible arm would allow the inertia of the striker to ping the bell without resting on it to avoid dampening the note.

That's exactly what I have in mind.

Frank
 
twofingers

Guru

Joined: 02/06/2014
Location: Germany
Posts: 1704
Posted: 06:52pm 28 Nov 2025
Copy link to clipboard 
Print this post

Hi Frank,
what I still don't understand is, if you have a solution for striking a tube once, why do you think it also works on the second strike - for example, after an eighth of a second? Is the tube in the exact same position as after the first strike? Wouldn't it have to be for it to work?

Perhaps I simply don't understand your design; if so, please ignore the question.
Kind regards
Michael
causality ≠ correlation ≠ coincidence
 
Mixtel90

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 8374
Posted: 06:57pm 28 Nov 2025
Copy link to clipboard 
Print this post

I wonder if the tubes could be supported horizontally and hit from the bottom?
Just a thought...
Mick

Zilog Inside! nascom.info for Nascom & Gemini
Preliminary MMBasic docs & my PCB designs
 
Frank N. Furter
Guru

Joined: 28/05/2012
Location: Germany
Posts: 1022
Posted: 07:55pm 28 Nov 2025
Copy link to clipboard 
Print this post

  twofingers said  what I still don't understand is, if you have a solution for striking a tube once, why do you think it also works on the second strike - for example, after an eighth of a second? Is the tube in the exact same position as after the first strike? Wouldn't it have to be for it to work?
Take another look at Volhout's link on the first page—it was implemented in a similar way:
https://github.com/keredson/chimes?tab=readme-ov-file

  Mixtel90 said  I wonder if the tubes could be supported horizontally and hit from the bottom?
Yes, I've already thought about that. Would I then have to drill the holes at the same distance from the end of the pipe as the upper holes?

Frank
 
NPHighview

Senior Member

Joined: 02/09/2020
Location: United States
Posts: 215
Posted: 01:01am 30 Nov 2025
Copy link to clipboard 
Print this post

Metal bars held horizontally might be better. That's called a Glockenspiel, and used instruments are generally available on eBay for ~$100. "Toy" glocks, with 27 notes (50% larger range than your samples) are available for ~$25.

They already have the right "suspension" for the bars, and are designed to be struck repeatedly, and fast.
Live in the Future. It's Just Starting Now!
 
Mixtel90

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 8374
Posted: 07:56am 30 Nov 2025
Copy link to clipboard 
Print this post

At it's fundamental frequency an open ended tube has an antinode at each end and in the centre, where it has it's greatest movement. There will be two node points that are at 0.224xL (where L is the length of the tube) from each end. Any supports, whether for hanging or for horizontal tubes or bars should be at these points only. It doesn't matter whether or not there are unused holes at these points as the object isn't moving.

Another thing about hitting tubes is that they don't produce harmonics but they do produce overtones. These are not always related to the fundamental and can sound rather nasty (bells do this too). One of the best ways to reduce these is to use a soft striker rather than a hard one. The other way is to use some sort of mechanical damping at positions along the tube where they are produced, but that gets a bit complicated as you don't want to damp the fundamental.
.
Edited 2025-11-30 18:09 by Mixtel90
Mick

Zilog Inside! nascom.info for Nascom & Gemini
Preliminary MMBasic docs & my PCB designs
 
Frank N. Furter
Guru

Joined: 28/05/2012
Location: Germany
Posts: 1022
Posted: 11:56am 30 Nov 2025
Copy link to clipboard 
Print this post

@Mixtel90:

Thank you very much for your comments—that's very interesting! I received the electromagnets yesterday. I'll set up a test rig in the near future.

Frank
 
zeitfest
Guru

Joined: 31/07/2019
Location: Australia
Posts: 641
Posted: 12:26pm 30 Nov 2025
Copy link to clipboard 
Print this post

Years ago my parents had a "ding dong" doorbell. As a kid I opened it up, it had
two metal bars to produce the "ding" and "dong" and a striker on a spring. When the button switch was pressed, a solenoid pulled the striker which hit one bar. When the button was released, the solenoid was de-energised and the spring retracted the striker the opposite way and the inertia made it hit the other bar. It ran on two  "D" cells and the push button, the batteries didn't last long  which caused a few problems  

PS (ed) lately I tried square aluminium tubing 2.5cm ..the idea was based on what I  I had read, that even-harmonics add to a sine shape and sound ok, and odd-harmonics add to create a square or triangular waveform which sounds harsh or sharp. So just for a bit of fun I tried the tubing that I had. If it is supported at the halfway point and is struck at about a quarter of the length is sounds quite mellow, but if I hold it at approx a third of its length and hit at the other third point, it sounds quite sharp and doesn't ring for long.
Edited 2025-11-30 22:49 by zeitfest
 
twofingers

Guru

Joined: 02/06/2014
Location: Germany
Posts: 1704
Posted: 06:26pm 30 Nov 2025
Copy link to clipboard 
Print this post

  Frank N. Furter said  ... Take another look at Volhout's link on the first page—it was implemented in a similar way:
https://github.com/keredson/chimes?tab=readme-ov-file
...
Frank

Hi Frank,
I watched the YouTube video (Hark, the herald-angels sing, https://www.cpdl.org/wiki/images/5/54/AMNS_35_Mendelssohn_Harmony.pdf). You're right. The tubes move less than I would expect. That's probably due to the weight of the tubes, as well as the low impact energy. Something you should take into account. The spring tension probably needs to be considered in particular.
However, the sound isn't good to me - as a non-musician, a bit off-key, not to say wrong. But that has its charm, too.
I should perhaps add that I like "keredson's" (Derek Anderson's) project and respect his work.

I downloaded the YouTube video as an MP3 and fed it into Cooledit. It looks like this:



I'm curious to see what you find out...

I've also ordered two microphones:



  Quote  The SPU0414HR5H-SB is a miniature, high-performance, low-power, top-port silicon microphone. Using Knowles’ proven high performance SiSonic™ MEMS technology, the SPU0414HR5H-SB consists of an acoustic sensor, a low-noise input buffer, and an output amplifier.


Perhaps the Pico can record and analyze short samples?

Kind regards
Michael
Edited 2025-12-01 19:49 by twofingers
causality ≠ correlation ≠ coincidence
 
     Page 6 of 7    
Print this page
The Back Shed's forum code is written, and hosted, in Australia.
© JAQ Software 2025