# Metronome - Beats and Measures

**URL:** <https://forum.xod.io/t/metronome-beats-and-measures/3682>\
**Category:** Uncategorized\
**Created:** [March 26, 2020, 8:18pm UTC](https://forum.xod.io/t/metronome-beats-and-measures/3682 "2020-03-26T20:18:06Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![alwaysuptil1](https://avatars.discourse-cdn.com/v4/letter/a/ba8739/32.png) [@alwaysuptil1](https://forum.xod.io/u/alwaysuptil1)\
**Post date:** [March 26, 2020, 8:18pm UTC](https://forum.xod.io/t/metronome-beats-and-measures/3682/1 "2020-03-26T20:18:06Z")

</div>

Brand New to coding and XOD. I’ve done the tutorial but havent been able to get my head around trying to make a timer display beats and measures.

I want to advance a digit every 4 pulses. I want to be able to see the pulses and I want to be able to adjust the number of pulses before the digit advances. 1: 1, 1:2, 1:3, 1:4, 2:1, 2:2, 2:3, 2:4, etcc…

adding a click would be nice too!

Any help is very much appreciated!

---

<div class="post-metadata">

**Author:** ![gweimer](https://avatars.discourse-cdn.com/v4/letter/g/a9adbd/32.png) [@gweimer](https://forum.xod.io/u/gweimer)\
**Post date:** [March 26, 2020, 8:50pm UTC](https://forum.xod.io/t/metronome-beats-and-measures/3682/2 "2020-03-26T20:50:27Z")

</div>

A simple solution using count-to-n to generate beats:

![image](https://canada1.discourse-cdn.com/flex027/uploads/xod/original/2X/f/f039563a9202568f78fe6443b8b718f9890d8904.png)

“count” only gets updated when count-to-n resets (when it has counted its N beats; 4 in this example). I don’t know what hardware you have, so I have no idea how you want to generate a click, but pulse-on-change output can be used to trigger the click. I’m guessing for music, you probably want to use a fractional count-to-n-T so beats are closer than 1 second apart as in this example.

If you have something else generating beats, then you can’t use count-to-n, so you will have to build your own count circuit to count the beats. Here is one example:  
 ![image](https://canada1.discourse-cdn.com/flex027/uploads/xod/original/2X/a/a865ca86a62105f193ca1d0ac19ac6565d052506.png)  
The top count node counts beats & resets when it reaches the desired number (greater-or-equal to 4 in this example). The same time it resets the beat counter, it increments the measure count node below. The click is triggered by the same output that triggers the count-INC for counting beats at the top.

---

<div class="post-metadata">

**Author:** ![alwaysuptil1](https://avatars.discourse-cdn.com/v4/letter/a/ba8739/32.png) [@alwaysuptil1](https://forum.xod.io/u/alwaysuptil1)\
**Post date:** [March 26, 2020, 8:53pm UTC](https://forum.xod.io/t/metronome-beats-and-measures/3682/3 "2020-03-26T20:53:59Z")

</div>

Wow, wow, wow, wow, wow! I can’t thank you enough! These are great and will be so helpful as I learn more about all of this. I’m 51 and just learning to code.

I really can’t thank you enough.

Sincerely,

~ C

---

<div class="post-metadata">

**Author:** ![alwaysuptil1](https://avatars.discourse-cdn.com/v4/letter/a/ba8739/32.png) [@alwaysuptil1](https://forum.xod.io/u/alwaysuptil1)\
**Post date:** [March 26, 2020, 9:25pm UTC](https://forum.xod.io/t/metronome-beats-and-measures/3682/4 "2020-03-26T21:25:05Z")

</div>

What’s weird is that I don’t have either nodes: **count-to-n** or **greater-or-equal**.

I’m going to research getting those into my desktop app.

---

<div class="post-metadata">

**Author:** ![alwaysuptil1](https://avatars.discourse-cdn.com/v4/letter/a/ba8739/32.png) [@alwaysuptil1](https://forum.xod.io/u/alwaysuptil1)\
**Post date:** [March 26, 2020, 9:41pm UTC](https://forum.xod.io/t/metronome-beats-and-measures/3682/5 "2020-03-26T21:41:25Z")

</div>

found it. did a search and realized I didn’t have the [marcoaita/malibrary](https://xod.io/libs/marcoaita/malibrary) installed.

went into my XOD Desktop app and under the File pulldown menu, there is ‘Add Library…’

typed in malibrary and found it.

Thanks again.

---

<div class="post-metadata">

**Author:** ![gweimer](https://avatars.discourse-cdn.com/v4/letter/g/a9adbd/32.png) [@gweimer](https://forum.xod.io/u/gweimer)\
**Post date:** [March 26, 2020, 9:44pm UTC](https://forum.xod.io/t/metronome-beats-and-measures/3682/6 "2020-03-26T21:44:07Z")

</div>

Sorry about that. I forget about having extra libraries and didn’t realize I was using nodes that aren’t built in.

---

<div class="post-metadata">

**Author:** ![alwaysuptil1](https://avatars.discourse-cdn.com/v4/letter/a/ba8739/32.png) [@alwaysuptil1](https://forum.xod.io/u/alwaysuptil1)\
**Post date:** [March 26, 2020, 9:46pm UTC](https://forum.xod.io/t/metronome-beats-and-measures/3682/7 "2020-03-26T21:46:03Z")

</div>

No need to apologize. You REALLY helped me. Thank you for taking the time to do so. 👍

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex027/uploads/xod/original/1X/eb7348baa04192c2ef932d1db54d44f09f8a7888.png) [@system](https://forum.xod.io/u/system)\
**Post date:** [March 28, 2020, 9:46pm UTC](https://forum.xod.io/t/metronome-beats-and-measures/3682/8 "2020-03-28T21:46:08Z")

</div>

Closed on March 28, 2020, 9:46pm UTC

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.
