Skip to content

Releases: cleishm/frequency-cpp

v1.1.2

10 Feb 03:49

Choose a tag to compare

What's Changed

  • Add CONFIG_FREQUENCY_STD_FORMAT flag for configuring std::format support
  • Don't include the dist directory in source control

Full Changelog: v1.1.1...v1.1.2

v1.1.1

18 Jan 16:52

Choose a tag to compare

Bug Fixes

  • Fix ESP-IDF script mode compatibility by moving ESP_PLATFORM check before project()

v1.1.0

18 Jan 16:45

Choose a tag to compare

What's New

  • Add ESP-IDF component support for publishing to the ESP Component Registry
  • Add idf_component.yml manifest
  • Add ESP_PLATFORM detection in CMakeLists.txt

The component is now available at: https://components.espressif.com/components/cleishm/frequency

v1.0.0 - First Stable Release

17 Jan 06:06

Choose a tag to compare

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-cpp

Manual 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::duration

Documentation

See the README for full documentation.