5
5
#ifndef CRONE_BUS_H
6
6
#define CRONE_BUS_H
7
7
8
- #include < boost/assert.hpp >
8
+ #include < cassert >
9
9
#include " Utilities.h"
10
10
11
11
namespace softcut_jack_osc {
@@ -28,7 +28,7 @@ namespace softcut_jack_osc {
28
28
29
29
// clear the first N frames in the bus
30
30
void clear (size_t numFrames) {
31
- BOOST_ASSERT (numFrames < BlockSize);
31
+ assert (numFrames < BlockSize);
32
32
for (size_t ch=0 ; ch<NumChannels; ++ch) {
33
33
for (size_t fr=0 ; fr<numFrames; ++fr) {
34
34
buf[ch][fr] = 0 .f ;
@@ -38,7 +38,7 @@ namespace softcut_jack_osc {
38
38
39
39
// copy from bus, with no scaling (overwrites previous contents)
40
40
void copyFrom (Bus &b, size_t numFrames) {
41
- BOOST_ASSERT (numFrames < BlockSize);
41
+ assert (numFrames < BlockSize);
42
42
for (size_t ch=0 ; ch<NumChannels; ++ch) {
43
43
for (size_t fr=0 ; fr<numFrames; ++fr) {
44
44
buf[ch][fr] = b.buf [ch][fr];
@@ -48,7 +48,7 @@ namespace softcut_jack_osc {
48
48
49
49
// copy from bus to pointer array, with no scaling (overwrites previous contents)
50
50
void copyTo (float *dst[NumChannels], size_t numFrames) {
51
- BOOST_ASSERT (numFrames < BlockSize);
51
+ assert (numFrames < BlockSize);
52
52
for (size_t ch=0 ; ch<NumChannels; ++ch) {
53
53
for (size_t fr=0 ; fr<numFrames; ++fr) {
54
54
dst[ch][fr] = buf[ch][fr];
@@ -59,7 +59,7 @@ namespace softcut_jack_osc {
59
59
60
60
// sum from bus, without amplitude scaling
61
61
void addFrom (BusT &b, size_t numFrames) {
62
- BOOST_ASSERT (numFrames < BlockSize);
62
+ assert (numFrames < BlockSize);
63
63
for (size_t ch=0 ; ch<NumChannels; ++ch) {
64
64
for (size_t fr=0 ; fr<numFrames; ++fr) {
65
65
buf[ch][fr] += b.buf [ch][fr];
@@ -69,7 +69,7 @@ namespace softcut_jack_osc {
69
69
70
70
// mix from bus, with fixed amplitude
71
71
void mixFrom (BusT &b, size_t numFrames, float level) {
72
- BOOST_ASSERT (numFrames < BlockSize);
72
+ assert (numFrames < BlockSize);
73
73
for (size_t ch=0 ; ch<NumChannels; ++ch) {
74
74
for (size_t fr=0 ; fr<numFrames; ++fr) {
75
75
buf[ch][fr] += b.buf [ch][fr] * level;
@@ -80,7 +80,7 @@ namespace softcut_jack_osc {
80
80
81
81
// mix from bus, with smoothed amplitude
82
82
void mixFrom (BusT &b, size_t numFrames, LogRamp &level) {
83
- BOOST_ASSERT (numFrames < BlockSize);
83
+ assert (numFrames < BlockSize);
84
84
float l;
85
85
for (size_t fr=0 ; fr<numFrames; ++fr) {
86
86
l = level.update ();
@@ -92,7 +92,7 @@ namespace softcut_jack_osc {
92
92
93
93
// apply smoothed amplitude
94
94
void applyGain (size_t numFrames, LogRamp &level) {
95
- BOOST_ASSERT (numFrames < BlockSize);
95
+ assert (numFrames < BlockSize);
96
96
float l;
97
97
for (size_t fr=0 ; fr<numFrames; ++fr) {
98
98
l = level.update ();
@@ -104,7 +104,7 @@ namespace softcut_jack_osc {
104
104
105
105
// mix from pointer array, with smoothed amplitude
106
106
void mixFrom (const float *src[NumChannels], size_t numFrames, LogRamp &level) {
107
- BOOST_ASSERT (numFrames < BlockSize);
107
+ assert (numFrames < BlockSize);
108
108
float l;
109
109
for (size_t fr=0 ; fr<numFrames; ++fr) {
110
110
l = level.update ();
@@ -116,7 +116,7 @@ namespace softcut_jack_osc {
116
116
117
117
// set from pointer array, with smoothed amplitude
118
118
void setFrom (const float *src[NumChannels], size_t numFrames, LogRamp &level) {
119
- BOOST_ASSERT (numFrames < BlockSize);
119
+ assert (numFrames < BlockSize);
120
120
float l;
121
121
for (size_t fr=0 ; fr<numFrames; ++fr) {
122
122
l = level.update ();
@@ -128,7 +128,7 @@ namespace softcut_jack_osc {
128
128
129
129
// set from pointer array, without scaling
130
130
void setFrom (const float *src[NumChannels], size_t numFrames) {
131
- BOOST_ASSERT (numFrames < BlockSize);
131
+ assert (numFrames < BlockSize);
132
132
for (size_t fr=0 ; fr<numFrames; ++fr) {
133
133
for (size_t ch=0 ; ch<NumChannels; ++ch) {
134
134
buf[ch][fr] = src[ch][fr];
@@ -138,7 +138,7 @@ namespace softcut_jack_osc {
138
138
139
139
// mix to pointer array, with smoothed amplitude
140
140
void mixTo (float *dst[NumChannels], size_t numFrames, LogRamp &level) {
141
- BOOST_ASSERT (numFrames < BlockSize);
141
+ assert (numFrames < BlockSize);
142
142
float l;
143
143
for (size_t fr=0 ; fr<numFrames; ++fr) {
144
144
l = level.update ();
@@ -150,7 +150,7 @@ namespace softcut_jack_osc {
150
150
151
151
// mix from stereo bus with 2x2 level matrix
152
152
void stereoMixFrom (BusT &b, size_t numFrames, const float level[4 ]) {
153
- BOOST_ASSERT (numFrames < BlockSize);
153
+ assert (numFrames < BlockSize);
154
154
for (size_t fr = 0 ; fr < numFrames; ++fr) {
155
155
buf[0 ][fr] += b.buf [0 ][fr] * level[0 ] + b.buf [1 ][fr] * level[2 ];
156
156
buf[1 ][fr] += b.buf [0 ][fr] * level[1 ] + b.buf [1 ][fr] * level[3 ];
@@ -159,7 +159,7 @@ namespace softcut_jack_osc {
159
159
160
160
// mix from two busses with balance coefficient (linear)
161
161
void xfade (BusT &a, BusT &b, size_t numFrames, LogRamp &level) {
162
- BOOST_ASSERT (numFrames < BlockSize);
162
+ assert (numFrames < BlockSize);
163
163
float x, y, c;
164
164
for (size_t fr=0 ; fr<numFrames; ++fr) {
165
165
c = level.update ();
@@ -173,7 +173,7 @@ namespace softcut_jack_osc {
173
173
174
174
// mix from two busses with balance coefficient (equal power)
175
175
void xfadeEp (BusT &a, BusT &b, size_t numFrames, LogRamp &level) {
176
- BOOST_ASSERT (numFrames < BlockSize);
176
+ assert (numFrames < BlockSize);
177
177
float x, y, l, c, d;
178
178
for (size_t fr=0 ; fr<numFrames; ++fr) {
179
179
l = level.update () * (float )M_PI_2;
@@ -189,7 +189,7 @@ namespace softcut_jack_osc {
189
189
190
190
// mix from mono->stereo bus, with level and pan (linear)
191
191
void panMixFrom (Bus<1 , BlockSize> a, size_t numFrames, LogRamp &level, LogRamp& pan) {
192
- BOOST_ASSERT (numFrames < BlockSize);
192
+ assert (numFrames < BlockSize);
193
193
static_assert (NumChannels > 1 , " using panMixFrom() on mono bus" );
194
194
float l, c, x;
195
195
for (size_t fr=0 ; fr<numFrames; ++fr) {
@@ -204,7 +204,7 @@ namespace softcut_jack_osc {
204
204
205
205
// mix from mono->stereo bus, with level and pan (equal power)
206
206
void panMixEpFrom (Bus<1 , BlockSize> a, size_t numFrames, LogRamp &level, LogRamp& pan) {
207
- BOOST_ASSERT (numFrames < BlockSize);
207
+ assert (numFrames < BlockSize);
208
208
static_assert (NumChannels > 1 , " using panMixFrom() on mono bus" );
209
209
float l, c, x;
210
210
for (size_t fr=0 ; fr<numFrames; ++fr) {
0 commit comments