Pulp 1.88.0
Cross-platform audio plugin framework
Loading...
Searching...
No Matches
quantize.hpp File Reference
#include <pulp/timebase/tick.hpp>
#include <algorithm>
#include <cmath>
#include <cstdint>

Go to the source code of this file.

Classes

struct  pulp::timebase::SwingRatio

Namespaces

namespace  pulp
namespace  pulp::timebase
namespace  pulp::timebase::detail

Functions

bool pulp::timebase::valid_sample_rate (double sample_rate) noexcept
bool pulp::timebase::valid_tempo (double tempo_bpm) noexcept
bool pulp::timebase::valid_grid (double grid_beats) noexcept
double pulp::timebase::beats_per_bar (int numerator, int denominator) noexcept
double pulp::timebase::frames_to_beats (double frames, double sample_rate, double tempo_bpm) noexcept
double pulp::timebase::beats_to_frames (double beats, double sample_rate, double tempo_bpm) noexcept
double pulp::timebase::next_grid_boundary (double position_beats, double grid_beats) noexcept
constexpr bool pulp::timebase::valid_swing_grid (TickDuration grid) noexcept
constexpr bool pulp::timebase::valid_swing_ratio (SwingRatio ratio) noexcept
constexpr std::int64_t pulp::timebase::detail::floor_div (std::int64_t numerator, std::int64_t denominator) noexcept
constexpr std::int64_t pulp::timebase::detail::rounded_scale (std::int64_t value, std::int64_t multiplier, std::int64_t divisor) noexcept
constexpr std::int64_t pulp::timebase::detail::swing_pivot (std::int64_t pair, SwingRatio ratio) noexcept
TickDuration pulp::timebase::swing_displacement (TickPosition position, TickDuration grid, SwingRatio ratio) noexcept
TickPosition pulp::timebase::swing_position (TickPosition position, TickDuration grid, SwingRatio ratio) noexcept
TickPosition pulp::timebase::unswing_position (TickPosition position, TickDuration grid, SwingRatio ratio) noexcept

Variables

constexpr double pulp::timebase::kBoundaryEpsilonBeats = 1.0e-9
constexpr SwingRatio pulp::timebase::kStraightSwing {1, 2}
constexpr SwingRatio pulp::timebase::kTripletSwing {2, 3}
constexpr std::int64_t pulp::timebase::kMaxSwingGridTicks = 1'000'000'000
constexpr std::int64_t pulp::timebase::kMaxSwingDenominator = 1'000'000