| 
    
Forum Index : Microcontroller and PC projects : read out carolling christmas bells
|    Page 1 of 2     | 
      
    |||||
| Author | Message | ||||
| Frank N. Furter Guru Joined: 28/05/2012 Location: GermanyPosts: 966  | 
    
    
 Hi to all, I have this carolling christmas bells and would like to recreate it. Do you have any idea how I could read the tone sequences of the 12 bells with an Picomite?   My carolling christmas sounds just like in this video. https://www.youtube.com/watch?v=kMaAlwRZgPU Or does anyone know where I can find these sound sequences in digital form??? Frank  | 
  ||||
| phil99 Guru Joined: 11/02/2018 Location: AustraliaPosts: 2802  | 
    
    
 In the photo the wire bundle appears to get thinner as it goes along each string of bells, so I am guessing there is a common plus 1 wire to each striker solenoid. If so perhaps the Port() Function can be used to record the sequence of strikes for each string. If there is no practical way to connect to the solenoids sewing pins could be pressed into the wires. It may be possible to record the tone of each bell with a microphone, amp and FIN on a Picomite. Or if you can capture the audio from that video you could use Audacity to find the tone and timing of each bell. Edited 2025-11-02 19:57 by phil99  | 
  ||||
| twofingers Guru Joined: 02/06/2014 Location: GermanyPosts: 1662  | 
    
    
 Hi Frank, is it about the sequence of notes (melody), or the sound of the bells? Regards Michael causality ≠ correlation ≠ coincidence  | 
  ||||
| Frank N. Furter Guru Joined: 28/05/2012 Location: GermanyPosts: 966  | 
    
    
 @phill99: I had already opened it up several years ago. The 12 bell signals are simply routed to a ULN2003 or similar. I would have no problem soldering the appropriate voltage dividers to the µC lines to tap the signals. That's a great idea! Unfortunately, I have no idea how to do that with Audacity...   @twofingers: The sequence of musical notes is important to me, or rather, when which µC output is switched at what point in time. Frank  | 
  ||||
| twofingers Guru Joined: 02/06/2014 Location: GermanyPosts: 1662  | 
    
    
 I'm still not sure if I understand you correctly. The melodies (sheet music) of most songs should be available online. If you want to use a PicoMite for analysis, I would try using the MATH FFT function. That can give you the frequency of the main tone. I usually use the ancient Cool Edit 2000 for sound analysis, which also offers comprehensive frequency analysis. However, Cool Edit is probably over 30 years old and is no longer officially available. Another option is, for example, ChatGPT (or similar). ChatGPT also analyzes the main frequency, and perhaps even more. Modern times. Kind regards Michael causality ≠ correlation ≠ coincidence  | 
  ||||
| phil99 Guru Joined: 11/02/2018 Location: AustraliaPosts: 2802  | 
    
    
 It is some years since I used Audacity but I recall it has a time scale below the view of the waveform. Like a long oscilloscope trace. From that you can see when each bell is struck. By magnifying the timescale and scrolling along it you should be able to see the envelope of each chime. By magnifying the timescale further still you can see the cycles within each chime to calculate its frequency. As for capturing the audio there is probably some way to intercept the data stream to the sound card, saving it as .wav. Failing that record from the audio line out socket. Perhaps loop back to line in.  | 
  ||||
| Frank N. Furter Guru Joined: 28/05/2012 Location: GermanyPosts: 966  | 
    
    
 I want to recreate the carolling christmas bells with a xylophone. To do this, I need the sequence of the bells. I don't care about the frequencies — I just want to know when to strike which tone element. Reading it from the musical notes is too tedious for me. In principle, I need a 12-channel logic analyzer to record the sound sequences. I'm just not sure how I can achieve that with an Picomite. I would have 12 inputs there, but I can't trigger an interrupt for each of them. I could connect each of the 12 inputs to an additional input via diodes and trigger an interrupt there. ...or should I just poll the inputs? Can I read in all the pins at once? Frank  | 
  ||||
| NPHighview Senior Member Joined: 02/09/2020 Location: United StatesPosts: 213  | 
    
    
 Some thoughts from listening to the YouTube video: * The sequence is over 40 minutes long. I was able to convert it to MP3 using one of the on-line "YouTube to MP3" converters. The resulting mid-quality file is 36 MBytes, far too large for MMBasic to play unmodified. Message me and I'll send you the MP3 file. * If you use GoldWave or another audio editor, you may be able to break up the 40+ minute recording into individual songs, then save them individually to the SD card. Your MMBasic program could pull each in sequence, or randomize the sequence if you'd rather. * There are a number of paid and free tools to convert an MP3 to MIDI; "Basic Pitch" from Spotify hung up and never completed. I didn't download "AnthemScore" - it's free trial only will do 30 seconds of audio, and I don't have a use for this otherwise. * Listening to the first two songs, I noticed that the span is over an octave. If the main range is from C to C, there are times when a lower B flat is played. * Playing the MP3 file in the background while writing this, I hear that most are in the key of C, but some aren't, with an even broader range of notes. * There are also times when multiple notes are played at the same time, for harmony. It sounds like the originators may have had spring-wound music box mechanisms to record. The music box "pins and springs" mechanism may provide you with the mental model you need. * Harkening back to the dawn of my career in the 1970s, you may be able to set up "tone detectors" using LM567 phase-locked loops, one per Xylophone key. Your set of ~20 of them would be tuned to each of the notes, and when detected, strike the Xylophone key through one solenoid per key. This would not accommodate the dynamics (softer vs. louder) that the music sometimes employs. Do you envision writing a MIDI interpreter for the Pico? Edited 2025-11-03 01:16 by NPHighview Live in the Future. It's Just Starting Now!  | 
  ||||
| NPHighview Senior Member Joined: 02/09/2020 Location: United StatesPosts: 213  | 
    
    
 I also asked Claud.ai for help. This is the response I received: Sounds like you could get assistance from our AI friends with your project. Live in the Future. It's Just Starting Now!  | 
  ||||
| NPHighview Senior Member Joined: 02/09/2020 Location: United StatesPosts: 213  | 
    
    
 After about 15 minutes, the songs on the YouTube video turn to gibberish. (I've been singing semi-professionally for 50+ years and have sung just about every winter holiday song imaginable). Just for fun, I Googled for "MIDI files for Christmas Carols Music Box" and came up with tons. One is https://www.classicalmidi.co.uk/christmas.htm Live in the Future. It's Just Starting Now!  | 
  ||||
| twofingers Guru Joined: 02/06/2014 Location: GermanyPosts: 1662  | 
    
    
 Hi Frank, If I understand you correctly, you are looking for this solution: For example, with serial parallel-to-serial shift registers such as the 74HC165 or an analog multiplexer such as the CD4051 or ... Just ask the AI ...   I think you are more interested in the process than in the finished solution? Michael Edited 2025-11-03 02:36 by twofingers causality ≠ correlation ≠ coincidence  | 
  ||||
| Frank N. Furter Guru Joined: 28/05/2012 Location: GermanyPosts: 966  | 
    
    
 Thank you very much, I converted the video to MP3 some time ago. 40 minutes? I remember that the pieces would repeat after about 20 minutes... Do you think this xylophone would work for the 12 bells?: https://www.ebay.de/itm/235287401611 No, I just want to control 12 electromagnets in the correct sequence... That looks very interesting: a timestamp and the musical note to be played. That should also be possible directly with the port pins of the Picomite. Not really! If you had a working solution, I would gladly take it.   Frank  | 
  ||||
| NPHighview Senior Member Joined: 02/09/2020 Location: United StatesPosts: 213  | 
    
    
 The second song has too wide a range of notes to work with the 12-key xylophone. The other songs, in the key of G, would have to be transposed into the key of C to have a chance. I asked Claude.ai for more information about how to drive solenoids based on MIDI sequences using the prompt: and got quite a detailed response. You should find this helpful. Edited 2025-11-03 12:05 by NPHighview Live in the Future. It's Just Starting Now!  | 
  ||||
| zeitfest Guru Joined: 31/07/2019 Location: AustraliaPosts: 618  | 
    
    
 Nice project !   There are " carillon " bellringing programs for PC's but I think they tend to play sound files instead of actually ringing bells... workable I guess but real bells are always good  | 
  ||||
| phil99 Guru Joined: 11/02/2018 Location: AustraliaPosts: 2802  | 
    
    
 An untested way to read from the solenoids. If it works change the Print line to print to a file. 'Reading the 12 outputs of a chiming bells ornament. (untested) 'It records the time (mS) when each bell is struck and the number of the bell(s) setpin gp0, din setpin gp1, din setpin gp2, din setpin gp3, din setpin gp4, din setpin gp5, din setpin gp6, din setpin gp7, din setpin gp8, din setpin gp9, din setpin gp10, din setpin gp11, din Dim integer Bells(200,2), n, tmp, tmp2 Timer = 0 for n = 0 to 200 'or whatever the sequence length is tmp = Port(gp0,12) do while Port(gp0,12) = tmp : loop : tmp2 = Port(gp0,12) 'wait for a chime Bells(n,0) = Timer Bells(n,1) = tmp2 Pause 50 'Wait for solenoid pulse to end. Make longer than a solenoid pulse. 'Needs to be shorter than the shortest interval between chimes next for n = 0 to 200 Print Bells(n,0), Bells(n,1), Bin$(Bells(n,1),12) next end Add solenoids to your xylophone (ok, the notes won't be exactly right but the melody may still be ok) and use the PORT Command to play back the file to the solenoids. Edited 2025-11-03 16:55 by phil99  | 
  ||||
| Frank N. Furter Guru Joined: 28/05/2012 Location: GermanyPosts: 966  | 
    
    
 That sounds quite interesting! Frank  | 
  ||||
| Volhout Guru Joined: 05/03/2018 Location: NetherlandsPosts: 5418  | 
    
    
 Frank, Check the voltage at the solenoids. When it is 5V or 12V, you will have to attenuate it to 3.3V before connecting it to a pico IO pin. Volhout P.S. If you look at the wiring it feels like the solenoids are in a matrix (3 rows, 4 columns) since the wire does not get thicker between solenoids 2,3,4 in a string. Maybe visual illusion. Maybe not. Edited 2025-11-03 20:05 by Volhout PicomiteVGA PETSCII ROBOTS  | 
  ||||
| Frank N. Furter Guru Joined: 28/05/2012 Location: GermanyPosts: 966  | 
    
    
 @Volhout: Thanks for the tip. I would like to tap the signals directly at the µC (5V) via voltage dividers. Frank  | 
  ||||
| Volhout Guru Joined: 05/03/2018 Location: NetherlandsPosts: 5418  | 
    
    
 Frank, Unless you are very much motivated to read the original tunes, here you can find a project that also has a link to MIDI files. Starting from a MIDI file is a lot easier, since you have timing and note information available already. DIY chimes The ESP32 python code to decode midi file could be re-written in MMBasic. Or maybe something like this already exists for the MM2. ? Volhout Edited 2025-11-03 20:27 by Volhout PicomiteVGA PETSCII ROBOTS  | 
  ||||
| phil99 Guru Joined: 11/02/2018 Location: AustraliaPosts: 2802  | 
    
    
 A less tedious way to set all the port pins. for n=0 to 11       setpin mm.info(pinno "GP"+str$(n)),DIN next  | 
  ||||
|    Page 1 of 2     | 
      
    |||||
| The Back Shed's forum code is written, and hosted, in Australia. | © JAQ Software 2025   |