CiCueTea v0.0.1
Loading...
Searching...
No Matches
Splicer.hpp
Go to the documentation of this file.
1//
2// Splicer.hpp
3// CQTDSP
4//
5// Created by Juan Sierra on 3/23/25.
6//
7
16
17#pragma once
18
19#include <Eigen/Core>
20
21namespace jsa::cicuetea {
22
31{
32 public:
44 Splicer(Eigen::Index newBlockSize, Eigen::Index newHopSize);
45
51 void pushBlock(const Eigen::ArrayXd& block);
52
58 double getSample();
59
65 Eigen::Index getBlockSize() const { return blockSize; }
66
72 Eigen::Index getOverlapSize() const { return overlapSize; }
73
79 Eigen::Index getHopSize() const { return hopSize; }
80
86 Eigen::Index getBufferSize() const { return bufferSize; }
87
88 private:
89 Eigen::ArrayXd buffer;
90 Eigen::Index bufferSize;
91 Eigen::Index blockSize;
92 Eigen::Index overlapSize;
93 Eigen::Index hopSize;
94 size_t wp = 0;
95 size_t rp = 0;
96};
97
98} // namespace jsa::cicuetea
Eigen::Index getHopSize() const
Gets the current hop size.
Definition Splicer.hpp:79
void pushBlock(const Eigen::ArrayXd &block)
Pushes a new audio block into the buffer.
Definition Splicer.cpp:30
Eigen::Index getBlockSize() const
Gets the current block size.
Definition Splicer.hpp:65
Splicer(Eigen::Index newBlockSize, Eigen::Index newHopSize)
Constructor sets the block size and hop size for the splicer.
Definition Splicer.cpp:18
double getSample()
Retrieves the next sample from the buffer.
Definition Splicer.cpp:44
Eigen::Index getBufferSize() const
Gets the current buffer size.
Definition Splicer.hpp:86
Eigen::Index getOverlapSize() const
Gets the current overlap size.
Definition Splicer.hpp:72