Releases: cleishm/frequency-cpp
Releases · cleishm/frequency-cpp
Release list
v1.2.0
What's new
- All frequency types now honor floating-point format specs, rendering the value in hertz:
std::format("{:.1f}", millihertz(1500))→"1.5Hz". The empty spec keeps the exact-count form ("1500mHz") unchanged. - The six per-type
to_stringoverloads and sixstd::formatterspecializations are replaced by one generic template each, covering everyfrequency<Rep, Precision>instantiation (including user-defined ones likefrequency<double, std::mega>) with byte-identical default output. - Version metadata is synced to 1.2.0 across CMakeLists.txt, idf_component.yml, docs/Doxyfile, and the vcpkg port (they had drifted).
Full Changelog: v1.1.3...v1.2.0
v1.1.3
What's Changed
- Remove the target restriction from the component manifest — the component is target-independent and now resolves on any ESP-IDF target
Full Changelog: v1.1.2...v1.1.3
v1.1.2
What's Changed
- Add
CONFIG_FREQUENCY_STD_FORMATflag for configuringstd::formatsupport - Don't include the dist directory in source control
Full Changelog: v1.1.1...v1.1.2
v1.1.1
v1.1.0
What's New
- Add ESP-IDF component support for publishing to the ESP Component Registry
- Add
idf_component.ymlmanifest - Add
ESP_PLATFORMdetection in CMakeLists.txt
The component is now available at: https://components.espressif.com/components/cleishm/frequency
v1.0.0 - First Stable Release
First Stable Release
frequency-cpp is a header-only C++20 library for type-safe frequency handling, modeled after std::chrono::duration.
Features
- Type-safe frequency types across multiple SI units (millihertz through terahertz)
- Intuitive API modeled after
std::chrono::duration - Compile-time safety with implicit/explicit conversion rules
- Musical operations: semitone shifts, octave shifts, harmonics
- Interoperability with
std::chrono::duration(period) and wavelength calculations - Header-only: No compilation required
- Comprehensive tests: Using Catch2 framework
Installation
Using vcpkg (coming soon)
vcpkg install cleishm-frequency-cppManual Installation
# Clone the repository
git clone https://github.com/cleishm/frequency-cpp.git
# Copy header to your include path
cp frequency-cpp/include/frequency/frequency.hpp /path/to/your/includes/Quick Start
#include <frequency/frequency.hpp>
using namespace freq;
using namespace freq::frequency_literals;
// Create frequencies
auto f1 = 440_Hz; // A4 note
auto f2 = kilohertz(1);
// Arithmetic operations
auto f3 = f1 * 2; // One octave up
auto f4 = f1.semitone_shift(12); // Also one octave up
// Convert to period
auto period = f1.period(); // std::chrono::durationDocumentation
See the README for full documentation.