Skip to content

Commit 6b6ec42

Browse files
committed
Merge branch 'main' of github.com:monome/softcut-lib
2 parents e30691c + 3b0f836 commit 6b6ec42

File tree

3 files changed

+53
-14
lines changed

3 files changed

+53
-14
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
n = NetAddr("localhost", 9999);
2+
3+
~setup = {
4+
5+
// load file
6+
f = "/home/emb/code/softcut-lib/pulse.wav";
7+
8+
n.sendMsg("/softcut/buffer/clear");
9+
n.sendMsg("/softcut/buffer/read_mono", f, 0, 0, 0.5, 0, 0);
10+
11+
// n.sendMsg("/softcut/buffer/write_mono", "/home/emb/code/softcut-lib/pulse_cutloop.wav", 0, 1.0, 0);
12+
13+
n.sendMsg("/set/enabled/cut", 0, 1);
14+
n.sendMsg("/set/level/cut", 0, 0.5);
15+
n.sendMsg("/set/pan/cut", 0, 0);
16+
17+
n.sendMsg("/set/param/cut/buffer", 0, 0);
18+
19+
n.sendMsg("/set/param/cut/loop_start", 0, 0);
20+
n.sendMsg("/set/param/cut/loop_end", 0, 1);
21+
n.sendMsg("/set/param/cut/loop_flag", 0, 0);
22+
23+
n.sendMsg("/set/param/cut/fade_time", 0, 0);
24+
25+
n.sendMsg("/set/param/cut/post_filter_lp", 0, 0);
26+
n.sendMsg("/set/param/cut/post_filter_hp", 0, 0);
27+
n.sendMsg("/set/param/cut/post_filter_bp", 0, 0);
28+
n.sendMsg("/set/param/cut/post_filter_br", 0, 0);
29+
n.sendMsg("/set/param/cut/post_filter_dry", 0, 1);
30+
n.sendMsg("/set/param/cut/play_flag", 0, 1);
31+
32+
};
33+
34+
~bang = {
35+
n.sendMsg("/set/param/cut/position", 0, 0);
36+
};
37+
38+
r = Routine {
39+
40+
var delta = 0.5;
41+
~setup.value;
42+
0.2.wait;
43+
44+
20.do({
45+
~bang.value;
46+
delta = delta * 0.9;
47+
delta.wait;
48+
});
49+
}.play;

clients/softcut_jack_osc/src/BufDiskWorker.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -177,13 +177,13 @@ void BufDiskWorker::readBufferMono(const std::string &path, BufDesc &buf,
177177

178178
auto numSrcChan = file.channels();
179179
chanSrc = std::min(numSrcChan - 1, std::max(0, chanSrc));
180-
// std::cout << "reading soundfile channel " << chanSrc << std::endl;
180+
std::cout << "reading soundfile channel " << chanSrc << std::endl;
181181

182182
auto *ioBuf = new float[numSrcChan * ioBufFrames];
183183
size_t numBlocks = frDur / ioBufFrames;
184184
size_t rem = frDur - (numBlocks * ioBufFrames);
185-
// std::cout << "file contains " << file.frames() << " frames" << std::endl;
186-
// std::cout << "reading " << numBlocks << " blocks and " << rem << " remainder frames..." << std::endl;
185+
std::cout << "file contains " << file.frames() << " frames" << std::endl;
186+
std::cout << "reading " << numBlocks << " blocks and " << rem << " remainder frames..." << std::endl;
187187
for (size_t block = 0; block < numBlocks; ++block) {
188188
int res = file.seek(frSrc, SF_SEEK_SET);
189189
if (res == -1) {

softcut-lib/src/FadeCurves.cpp

+1-11
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,6 @@
1414
using namespace softcut;
1515

1616
static constexpr float fpi = 3.1415926535898f;
17-
/*
18-
float FadeCurves::recDelayRatio;
19-
float FadeCurves::preWindowRatio;
20-
unsigned int FadeCurves::recDelayMinFrames;
21-
unsigned int FadeCurves::preWindowMinFrames;
22-
float FadeCurves::recFadeBuf[fadeBufSize];
23-
float FadeCurves::preFadeBuf[fadeBufSize];
24-
FadeCurves::Shape FadeCurves::recShape = Linear;
25-
FadeCurves::Shape FadeCurves::preShape = Linear;
26-
*/
2717

2818
void FadeCurves::init() {
2919
setPreShape(FadeCurves::Shape::Linear);
@@ -70,7 +60,7 @@ void FadeCurves::calcRecFade() {
7060
buf[n] = 1.f;
7161
} else if (recShape == Raised) {
7262
const float phi = fpi/(nr*2);
73-
float x = fpi;
63+
float x = 0.f;
7464
float y = 0.f;
7565
while (i < ndr) {
7666
buf[i++] = y;

0 commit comments

Comments
 (0)