Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
okyeron committed Oct 4, 2021
2 parents 8f81040 + 66fe5c0 commit 6f27914
Show file tree
Hide file tree
Showing 14 changed files with 68 additions and 17 deletions.
10 changes: 6 additions & 4 deletions crone/src/SoftcutClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ crone::SoftcutClient::SoftcutClient() : Client<2, 2>("softcut") {
}
bufIdx[0] = BufDiskWorker::registerBuffer(buf[0], BufFrames);
bufIdx[1] = BufDiskWorker::registerBuffer(buf[1], BufFrames);

}

void crone::SoftcutClient::process(jack_nframes_t numFrames) {
Expand Down Expand Up @@ -60,12 +59,12 @@ void crone::SoftcutClient::clearBusses(size_t numFrames) {

void crone::SoftcutClient::mixInput(size_t numFrames) {
for (int dst = 0; dst < NumVoices; ++dst) {
if (cut.getRecFlag(dst)) {
if (cut.getRecFlag(dst) && enabled[dst]) {
for (int ch = 0; ch < 2; ++ch) {
input[dst].mixFrom(&source[SourceAdc][ch], numFrames, inLevel[ch][dst]);
}
for (int src = 0; src < NumVoices; ++src) {
if (cut.getPlayFlag(src)) {
if (cut.getPlayFlag(src) && enabled[src]) {
input[dst].mixFrom(output[src], numFrames, fbLevel[src][dst]);
}
}
Expand All @@ -75,7 +74,7 @@ void crone::SoftcutClient::mixInput(size_t numFrames) {

void crone::SoftcutClient::mixOutput(size_t numFrames) {
for (int v = 0; v < NumVoices; ++v) {
if (cut.getPlayFlag(v)) {
if (cut.getPlayFlag(v) && enabled[v]) {
mix.panMixEpFrom(output[v], numFrames, outLevel[v], outPan[v]);
}
}
Expand All @@ -90,6 +89,9 @@ void crone::SoftcutClient::handleCommand(Commands::CommandPacket *p) {
//-- softcut routing
case Commands::Id::SET_ENABLED_CUT:
enabled[idx_0] = value > 0.f;
if (!enabled[idx_0]) {
cut.stopVoice(idx_0);
}
break;
case Commands::Id::SET_LEVEL_CUT:
outLevel[idx_0].setTarget(value);
Expand Down
2 changes: 1 addition & 1 deletion lua/core/paramset.lua
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,7 @@ function ParamSet:write(filename, name)
if fd then
io.output(fd)
if name then io.write("-- "..name.."\n") end
for _,param in pairs(self.params) do
for _,param in ipairs(self.params) do
if param.id and param.save and param.t ~= self.tTRIGGER then
io.write(string.format("%s: %s\n", quote(param.id), param:get()))
end
Expand Down
2 changes: 1 addition & 1 deletion lua/lib/intonation.lua
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ end
-- @treturn table
function JI.lamonte()
return {
1/1, 567/512, 9/8, 147/128, 21/16, 1323/1024, 189/128, 3/2, 49/32, 7/4, 441/256, 63/32
1/1, 567/512, 9/8, 147/128, 1323/1024, 21/16, 189/128, 3/2, 49/32, 441/256, 7/4,63/32
}
end

Expand Down
13 changes: 13 additions & 0 deletions lua/lib/tabutil.lua
Original file line number Diff line number Diff line change
Expand Up @@ -235,5 +235,18 @@ function tab.readonly(params)
return proxy
end

--- Create a new table with all values that pass the test implemented by the provided function.
-- @tparam table t table to check
-- @param condition callback function that tests all values of provided table, passes value and key as arguments
-- @treturn table table with values that pass the test
tab.select_values = function(tbl, condition)
local t = {}

for k,v in pairs(tbl) do
if condition(v,k) then t[k] = v end
end

return t
end

return tab
14 changes: 12 additions & 2 deletions matron/src/args.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
struct args {
char loc_port[ARG_BUF_SIZE];
char ext_port[ARG_BUF_SIZE];
char remote_port[ARG_BUF_SIZE];
char crone_port[ARG_BUF_SIZE];
char framebuffer[ARG_BUF_SIZE];
};
Expand All @@ -16,19 +17,21 @@ static struct args a = {
.loc_port = "8888",
.ext_port = "57120",
.crone_port = "9999",
.remote_port = "10111",
.framebuffer = "/dev/fb0",
};

int args_parse(int argc, char **argv) {
int opt;
while ((opt = getopt(argc, argv, "e:l:c:f:h")) != -1) {
while ((opt = getopt(argc, argv, "o:e:l:c:f:h")) != -1) {
switch (opt) {
case '?':
case 'h':
default:
fprintf(stdout, "Start matron with optional overrides:");
fprintf(stdout, "Start matron with optional overrides:\n");
fprintf(stdout, "-l override OSC local port [default %s]\n", a.loc_port);
fprintf(stdout, "-e override OSC ext port [default %s]\n", a.ext_port);
fprintf(stdout, "-o override OSC remote port [default %s]\n", a.remote_port);
fprintf(stdout, "-c override crone port [default %s]\n", a.crone_port);
fprintf(stdout, "-f override framebuffer file [default '%s']\n", a.framebuffer);

Expand All @@ -40,6 +43,9 @@ int args_parse(int argc, char **argv) {
case 'e':
strncpy(a.ext_port, optarg, ARG_BUF_SIZE - 1);
break;
case 'o':
strncpy(a.remote_port, optarg, ARG_BUF_SIZE - 1);
break;
case 'c':
strncpy(a.crone_port, optarg, ARG_BUF_SIZE - 1);
break;
Expand All @@ -59,6 +65,10 @@ const char *args_ext_port(void) {
return a.ext_port;
}

const char *args_remote_port(void) {
return a.remote_port;
}

const char *args_crone_port(void) {
return a.crone_port;
}
Expand Down
1 change: 1 addition & 0 deletions matron/src/args.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ extern int args_parse(int argc, char **argv);

extern const char *args_local_port(void);
extern const char *args_ext_port(void);
extern const char *args_remote_port(void);
extern const char *args_crone_port(void);
extern const char *args_monome_path(void);
extern const char *args_framebuffer(void);
5 changes: 4 additions & 1 deletion matron/src/device/device_monitor.c
Original file line number Diff line number Diff line change
Expand Up @@ -381,5 +381,8 @@ int is_dev_monome_grid(struct udev_device *dev) {

int is_dev_crow(struct udev_device *dev) {
const char *device_product_string = udev_device_get_property_value(dev, "ID_MODEL");
return strcmp(device_product_string, "crow:_telephone_line") == 0;
if(device_product_string != NULL) {
return strcmp(device_product_string, "crow:_telephone_line") == 0;
}
return 0;
}
6 changes: 5 additions & 1 deletion matron/src/hardware/stat.c
Original file line number Diff line number Diff line change
Expand Up @@ -91,11 +91,15 @@ void *stat_check(void *x) {
}

// check cpu
if ((fd = popen("head -n5 /proc/stat", "r")) == NULL) {
if ((fd = popen("cat /proc/stat", "r")) == NULL) {
fprintf(stderr, "Error opening pipe: cpu read\n");
} else {
int i = 0;
while (fgets(buf, 128, fd) != NULL) {
// stop reading when all cpus are checked
if (strncmp("cpu", buf, 3) != 0) {
break;
}
//fprintf(stderr,"%s", buf);
strtok(buf, " ");
user = atoi(strtok(NULL, " "));
Expand Down
3 changes: 2 additions & 1 deletion matron/src/oracle.c
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,8 @@ void o_init(void) {
const char *ext_port = args_ext_port();
const char *crone_port = args_crone_port();

fprintf(stderr, "OSC rx port: %s \nOSC crone port: %s\nOSC ext port: %s\n", local_port, crone_port, ext_port);
fprintf(stderr, "OSC rx port: %s \nOSC crone port: %s\nOSC ext port: %s\nOSC remote port: %s\n", local_port, crone_port, ext_port, args_remote_port());

o_init_descriptors();

ext_addr = lo_address_new("127.0.0.1", ext_port);
Expand Down
2 changes: 1 addition & 1 deletion matron/src/osc.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ static void lo_error_handler(int num, const char *m, const char *path);

void osc_init(void) {
// receive
st = lo_server_thread_new("10111", lo_error_handler);
st = lo_server_thread_new(args_remote_port(), lo_error_handler);
lo_server_thread_add_method(st, NULL, NULL, osc_receive, NULL);
lo_server_thread_start(st);

Expand Down
1 change: 0 additions & 1 deletion sc/norns-config.sc
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ Norns {
*initClass {
Norns.addIncludePath(Platform.userHomeDir ++ "/norns/sc/core");
Norns.addIncludePath(Platform.userHomeDir ++ "/norns/sc/engines");
Norns.addIncludePath(Platform.userHomeDir ++ "/norns/sc/ugens");
Norns.addIncludePath(Platform.userHomeDir ++ "/dust");
}
}
22 changes: 20 additions & 2 deletions update/changelog.txt
Original file line number Diff line number Diff line change
@@ -1,13 +1,31 @@
# 210826
# 210927

# norns-beta
# norns 2.6.0

- NEW hooks and mods system @ngwese @catfact
- NEW custom events, c bindings @ngwese
- NEW sequins library @tyleretters @trentgill
- NEW softcut non-real-time functions @ryleelyman
- NEW keyboard layouts @p3r7
- NEW hold K1 in SELECT to fast-scroll @dndrks
- FIX util.wrap and util.wrap_max bounds @dndrks
- FIX tab.count @discohead
- FIX crash when detecting crow @nihilazo
- FIX numerous docker-related fixes @winder
- FIX cleanup behavior with clean/load script @ngwese
- FIX support PSETs above 99 @p3r7
- NEW sky: add polyperc/polysub param def @ngwese
- NEW textentry: add keyboard support @p3r7
- NEW keyboard layouts menu selection @p3r7
- FIX softcut phase inversion @catfact

# maiden 1.1.4

- NEW preview audio files on device in browser @stvnrlly
- FIX explicit (instead of implicit) untitled script creation on initial landing view
- NEW loading animation when loading scripts/audio into editor
- NEW add version metadata to maiden cli @winder
- NEW allow release builds for any architecture @winder


# 210706
Expand Down
2 changes: 1 addition & 1 deletion update/version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
210826
210927

0 comments on commit 6f27914

Please sign in to comment.