@ -4,6 +4,8 @@ The **uClock BPM Generator library** is designed to implement precise and reliab
We have chosen PlatformIO and Arduino as our official deployment platforms. The library has been supported and tested on general **AVR boards (ATmega168/328, ATmega16u4/32u4, and ATmega2560)** as well as **ARM boards (Teensy, STM32XX, and Seedstudio XIAO M0)**.
We have chosen PlatformIO and Arduino as our official deployment platforms. The library has been supported and tested on general **AVR boards (ATmega168/328, ATmega16u4/32u4, and ATmega2560)** as well as **ARM boards (Teensy, STM32XX, and Seedstudio XIAO M0)**.
(See also the generic fallback mode)
The absence of real-time features necessary for creating professional-level embedded devices for music and video on Opensource community-based platforms like Arduino led to the development of uClock. By leveraging the use of timer hardware interruptions, the library can schedule and manage real-time-like processing with safe shared resource access through its API.
The absence of real-time features necessary for creating professional-level embedded devices for music and video on Opensource community-based platforms like Arduino led to the development of uClock. By leveraging the use of timer hardware interruptions, the library can schedule and manage real-time-like processing with safe shared resource access through its API.
With uClock, you gain the ability to create professional-grade sequencers, sync boxes, or generate a precise BPM clock for external devices in the realms of music, audio/video productions, performances, or tech art installations. The library offers an external synchronization schema that enables you to generate an internal clock based on an external clock source, allowing you to master your entire MIDI setup or any other protocols according to your specific preferences and requirements.
With uClock, you gain the ability to create professional-grade sequencers, sync boxes, or generate a precise BPM clock for external devices in the realms of music, audio/video productions, performances, or tech art installations. The library offers an external synchronization schema that enables you to generate an internal clock based on an external clock source, allowing you to master your entire MIDI setup or any other protocols according to your specific preferences and requirements.
@ -18,6 +20,28 @@ The uClock library API operates through attached callback functions mechanism:
5. **setOnClockStart(onClockStartCallback) > onClockStartCallback()** on uClock Start event
5. **setOnClockStart(onClockStartCallback) > onClockStartCallback()** on uClock Start event
6. **setOnClockStop(onClockStopCallback) > onClockStopCallback()** on uClock Stop event
6. **setOnClockStop(onClockStopCallback) > onClockStopCallback()** on uClock Stop event
### Generic mode - for unsupported boards (or avoiding usage of interrupts)
If a supported board isn't detected during compilation then a generic fallback approach will be used that does not utilise any interrupts to ensure accurate timekeeping. This can be useful to port projets to boards that do not have support in uClock yet, or to test if suspected bugs are related to interactions with interrupts or task handling.
You can force this non-interrupt "generic mode" even on supported boards by defining the build flag `USE_UCLOCK_GENERIC`.
In order for generic mode to work, you need to add a call to your `loop()` function to process ticks. For example,
```c++
// prototype of
void uClockCheckTime(uint32_t micros_time);
void loop() {
#ifdef USE_UCLOCK_GENERIC
uClockCheckTime(micros());
#endif
// do anything else you need to do inside loop()...
}
```
## uClock v2.0 Breakchanges
## uClock v2.0 Breakchanges
If you are comming from uClock version <2.0versionskeepattentiontothebreakchangessoyoucanupdateyourcodetothenewAPIinterfacechanges:
If you are comming from uClock version <2.0versionskeepattentiontothebreakchangessoyoucanupdateyourcodetothenewAPIinterfacechanges: