Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Remove legacy midiX variables

  • Loading branch information...
commit dde38d11d8382fb420ed75f782f891da49715fa9 1 parent d1f18e8
@sbourdeauducq sbourdeauducq authored
View
6 src/compiler/compiler.c
@@ -118,8 +118,7 @@ static void pfv_update_patch_requires(struct compiler_sc *sc, int pfv)
sc->p->require |= REQUIRE_DMX;
if(pfv >= pfv_osc1 && pfv <= pfv_osc4)
sc->p->require |= REQUIRE_OSC;
- if(pfv >= pfv_midi1 && pfv <= pfv_midi8)
- sc->p->require |= REQUIRE_MIDI;
+ // TODO: MIDI detection
if(pfv == pfv_video_a)
sc->p->require |= REQUIRE_VIDEO;
}
@@ -264,8 +263,7 @@ static void pvv_update_patch_requires(struct compiler_sc *sc, int pvv)
sc->p->require |= REQUIRE_DMX;
if(pvv >= pvv_osc1 && pvv <= pvv_osc4)
sc->p->require |= REQUIRE_OSC;
- if(pvv >= pvv_midi1 && pvv <= pvv_midi8)
- sc->p->require |= REQUIRE_MIDI;
+ // TODO: MIDI detection
}
static void pvv_bind_callback(void *_sc, struct fpvm_sym *sym, int reg)
View
18 src/compiler/compiler.h
@@ -128,15 +128,6 @@ enum {
pfv_osc3,
pfv_osc4,
- pfv_midi1,
- pfv_midi2,
- pfv_midi3,
- pfv_midi4,
- pfv_midi5,
- pfv_midi6,
- pfv_midi7,
- pfv_midi8,
-
pfv_video_a,
pfv_image1_a,
@@ -205,15 +196,6 @@ enum {
pvv_osc3,
pvv_osc4,
- pvv_midi1,
- pvv_midi2,
- pvv_midi3,
- pvv_midi4,
- pvv_midi5,
- pvv_midi6,
- pvv_midi7,
- pvv_midi8,
-
COMP_PVV_COUNT /* must be last */
};
View
9 src/compiler/fnp.ids
@@ -108,15 +108,6 @@ osc2 pfv_osc2 pvv_osc2 SF_LIVE
osc3 pfv_osc3 pvv_osc3 SF_LIVE
osc4 pfv_osc4 pvv_osc4 SF_LIVE
-midi1 pfv_midi1 pvv_midi1 SF_LIVE
-midi2 pfv_midi2 pvv_midi2 SF_LIVE
-midi3 pfv_midi3 pvv_midi3 SF_LIVE
-midi4 pfv_midi4 pvv_midi4 SF_LIVE
-midi5 pfv_midi5 pvv_midi5 SF_LIVE
-midi6 pfv_midi6 pvv_midi6 SF_LIVE
-midi7 pfv_midi7 pvv_midi7 SF_LIVE
-midi8 pfv_midi8 pvv_midi8 SF_LIVE
-
video_a pfv_video_a -1
image1_a pfv_image1_a -1
View
110 src/gui/midi.c
@@ -1,6 +1,6 @@
/*
* Flickernoise
- * Copyright (C) 2010, 2011 Sebastien Bourdeauducq
+ * Copyright (C) 2010, 2011, 2012 Sebastien Bourdeauducq
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -170,7 +170,6 @@ static void load_config(void)
char config_key[8];
int i;
const char *val;
- int value;
mtk_cmdf(appid, "e_channel.set(-text \"%d\")",
config_read_int("midi_channel", 0)+1);
@@ -182,27 +181,13 @@ static void load_config(void)
else
midi_bindings[i][0] = 0;
}
- for(i=0;i<MIDI_COUNT;i++) {
- sprintf(config_key, "midi%d", i+1);
- value = config_read_int(config_key, i);
- mtk_cmdf(appid, "e_midi%d.set(-text \"%d\")", i, value);
- }
}
static void set_config(void)
{
char config_key[16];
int i;
- int value;
-
- for(i=0;i<MIDI_COUNT;i++) {
- sprintf(config_key, "e_midi%d.text", i);
- value = mtk_req_i(appid, config_key);
- if((value < 0) || (value > 128))
- value = i;
- sprintf(config_key, "midi%d", i+1);
- config_write_int(config_key, value);
- }
+
for(i=0;i<128;i++) {
sprintf(config_key, "midi_%02x", i);
if(midi_bindings[i][0] != 0)
@@ -302,8 +287,7 @@ static void midi_event(mtk_event *e, int count)
break;
case EVENT_TYPE_MIDI_PITCH:
/* EVENT_TYPE_MIDI_PITCH */
- controller_event(chan, 128,
- e[i].press.code & 0x7f);
+ // TODO
break;
}
}
@@ -366,17 +350,6 @@ static void addupdate_callback(mtk_event *e, void *arg)
mtk_cmd(appid, "e_filename.set(-text \"\")");
}
-static void press_callback(mtk_event *e, void *arg)
-{
- learn = (int)arg;
- assert(learn >= 0 && learn < MIDI_COUNT);
-}
-
-static void release_callback(mtk_event *e, void *arg)
-{
- learn = -1;
-}
-
static int cmpstringp(const void *p1, const void *p2)
{
return strcmp(*(char * const *)p1, *(char * const *)p2);
@@ -451,29 +424,17 @@ static void autobuild_callback(mtk_event *e, void *arg)
void init_midi(void)
{
- int i;
-
appid = mtk_init_app("MIDI");
mtk_cmd_seq(appid,
"g = new Grid()",
-
- "g_parameters0 = new Grid()",
- "l_parameters = new Label(-text \"Global parameters\" -font \"title\")",
- "s_parameters1 = new Separator(-vertical no)",
- "s_parameters2 = new Separator(-vertical no)",
- "g_parameters0.place(s_parameters1, -column 1 -row 1)",
- "g_parameters0.place(l_parameters, -column 2 -row 1)",
- "g_parameters0.place(s_parameters2, -column 3 -row 1)",
+
"g_parameters = new Grid()",
- "l_channel = new Label(-text \"Channel (1-16):\")",
+ "l_channel = new Label(-text \"Patch switch channel (1-16):\")",
"e_channel = new Entry()",
"g_parameters.place(l_channel, -column 1 -row 1)",
"g_parameters.place(e_channel, -column 2 -row 1)",
-
- "g_sep = new Grid()",
-
- "g_patch = new Grid()",
+ "g.place(g_parameters, -column 1 -row 0)",
"g_existing0 = new Grid()",
"l_existing = new Label(-text \"Existing bindings\" -font \"title\")",
@@ -512,65 +473,34 @@ void init_midi(void)
"b_addupdate = new Button(-text \"Add/update\")",
"b_autobuild = new Button(-text \"Auto build\")",
- "g_patch.place(g_existing0, -column 1 -row 1)",
- "g_patch.place(lst_existingf, -column 1 -row 2)",
- "g_patch.rowconfig(2, -size 130)",
- "g_patch.place(g_addedit0, -column 1 -row 3)",
- "g_patch.place(g_addedit1, -column 1 -row 4)",
- "g_patch.place(b_addupdate, -column 1 -row 5)",
- "g_patch.place(b_autobuild, -column 1 -row 6)",
-
- "g_var = new Grid()",
-
- "g_cmap0 = new Grid()",
- "l_cmap = new Label(-text \"Controller mapping\" -font \"title\")",
- "s_cmap1 = new Separator(-vertical no)",
- "s_cmap2 = new Separator(-vertical no)",
- "g_cmap0.place(s_cmap1, -column 1 -row 1)",
- "g_cmap0.place(l_cmap, -column 2 -row 1)",
- "g_cmap0.place(s_cmap2, -column 3 -row 1)",
-
- "g_vars = new Grid()",
- "g_vars.columnconfig(2, -size 55)",
+ "g.place(g_existing0, -column 1 -row 1)",
+ "g.place(lst_existingf, -column 1 -row 2)",
+ "g.rowconfig(2, -size 130)",
+ "g.place(g_addedit0, -column 1 -row 3)",
+ "g.place(g_addedit1, -column 1 -row 4)",
+ "g.place(b_addupdate, -column 1 -row 5)",
+ "g.place(b_autobuild, -column 1 -row 6)",
+ "g_lastctl = new Grid()",
"l_lastctltxt = new Label(-text \"Latest active controller:\")",
"l_lastctl = new Label()",
-
- "g_var.place(g_cmap0, -column 1 -row 1)",
- "g_var.place(g_vars, -column 1 -row 2)",
- "g_var.place(l_lastctltxt, -column 1 -row 3)",
- "g_var.place(l_lastctl, -column 1 -row 4)",
-
- "g_sep.place(g_patch, -column 1 -row 1)",
- "sep = new Separator(-vertical yes)",
- "g_sep.place(sep, -column 2 -row 1)",
- "g_sep.place(g_var, -column 3 -row 1)",
+ "g_lastctl.place(l_lastctltxt, -column 1 -row 1)",
+ "g_lastctl.place(l_lastctl, -column 2 -row 1)",
+ "g.place(g_lastctl, -column 1 -row 7)",
"g_btn = new Grid()",
"b_ok = new Button(-text \"OK\")",
"b_cancel = new Button(-text \"Cancel\")",
- "g_btn.columnconfig(1, -size 450)",
+ "g_btn.columnconfig(1, -size 250)",
"g_btn.place(b_ok, -column 2 -row 1)",
"g_btn.place(b_cancel, -column 3 -row 1)",
- "g.place(g_parameters0, -column 1 -row 1)",
- "g.place(g_parameters, -column 1 -row 2)",
- "g.place(g_sep, -column 1 -row 3)",
- "g.rowconfig(4, -size 10)",
- "g.place(g_btn, -column 1 -row 5)",
+ "g.rowconfig(8, -size 10)",
+ "g.place(g_btn, -column 1 -row 9)",
"w = new Window(-content g -title \"MIDI settings\" -workx 10)",
0);
- for(i=0;i<MIDI_COUNT;i++) {
- mtk_cmdf(appid, "l_midi%d = new Label(-text \"\emidi%d\")", i, i+1);
- mtk_cmdf(appid, "e_midi%d = new Entry()", i);
- mtk_cmdf(appid, "g_vars.place(l_midi%d, -column 1 -row %d)", i, i);
- mtk_cmdf(appid, "g_vars.place(e_midi%d, -column 2 -row %d)", i, i);
- mtk_bindf(appid, "l_midi%d", "press", press_callback, (void *)i, i);
- mtk_bindf(appid, "l_midi%d", "release", release_callback, NULL, i);
- }
-
mtk_bind(appid, "lst_existing", "selchange", selchange_callback, NULL);
mtk_bind(appid, "lst_existing", "selcommit", selchange_callback, NULL);
mtk_bind(appid, "b_filename", "commit", browse_callback, NULL);
View
14 src/gui/monitor.c
@@ -1,6 +1,6 @@
/*
* Flickernoise
- * Copyright (C) 2010, 2011 Sebastien Bourdeauducq
+ * Copyright (C) 2010, 2011, 2012 Sebastien Bourdeauducq
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -36,7 +36,6 @@ static float bass, mid, treb;
static float bass_att, mid_att, treb_att;
static float idmx[IDMX_COUNT];
static float osc[OSC_COUNT];
-static float midi[MIDI_COUNT];
static void sampler_callback(struct frame_descriptor *frd)
{
@@ -57,8 +56,6 @@ static void sampler_callback(struct frame_descriptor *frd)
idmx[i] = frd->idmx[i];
for(i=0;i<OSC_COUNT;i++)
osc[i] = frd->osc[i];
- for(i=0;i<MIDI_COUNT;i++)
- midi[i] = frd->midi[i];
sampler_return(frd);
}
@@ -88,15 +85,6 @@ static float *get_variable(const char *name)
else if(strcmp(name, "osc2") == 0) return &osc[1];
else if(strcmp(name, "osc3") == 0) return &osc[2];
else if(strcmp(name, "osc4") == 0) return &osc[3];
-
- else if(strcmp(name, "midi1") == 0) return &midi[0];
- else if(strcmp(name, "midi2") == 0) return &midi[1];
- else if(strcmp(name, "midi3") == 0) return &midi[2];
- else if(strcmp(name, "midi4") == 0) return &midi[3];
- else if(strcmp(name, "midi5") == 0) return &midi[4];
- else if(strcmp(name, "midi6") == 0) return &midi[5];
- else if(strcmp(name, "midi7") == 0) return &midi[6];
- else if(strcmp(name, "midi8") == 0) return &midi[7];
else return NULL;
}
View
18 src/renderer/eval.c
@@ -106,15 +106,6 @@ static void transfer_pvv_regs(struct patch *p)
write_pvv(p, pvv_osc2, read_pfv(p, pfv_osc2));
write_pvv(p, pvv_osc3, read_pfv(p, pfv_osc3));
write_pvv(p, pvv_osc4, read_pfv(p, pfv_osc4));
-
- write_pvv(p, pvv_midi1, read_pfv(p, pfv_midi1));
- write_pvv(p, pvv_midi2, read_pfv(p, pfv_midi2));
- write_pvv(p, pvv_midi3, read_pfv(p, pfv_midi3));
- write_pvv(p, pvv_midi4, read_pfv(p, pfv_midi4));
- write_pvv(p, pvv_midi5, read_pfv(p, pfv_midi5));
- write_pvv(p, pvv_midi6, read_pfv(p, pfv_midi6));
- write_pvv(p, pvv_midi7, read_pfv(p, pfv_midi7));
- write_pvv(p, pvv_midi8, read_pfv(p, pfv_midi8));
}
static void reinit_pfv(struct patch *p, int pfv)
@@ -158,15 +149,6 @@ static void set_pfv_from_frd(struct patch *p, struct frame_descriptor *frd)
write_pfv(p, pfv_osc2, frd->osc[1]);
write_pfv(p, pfv_osc3, frd->osc[2]);
write_pfv(p, pfv_osc4, frd->osc[3]);
-
- write_pfv(p, pfv_midi1, frd->midi[0]);
- write_pfv(p, pfv_midi2, frd->midi[1]);
- write_pfv(p, pfv_midi3, frd->midi[2]);
- write_pfv(p, pfv_midi4, frd->midi[3]);
- write_pfv(p, pfv_midi5, frd->midi[4]);
- write_pfv(p, pfv_midi6, frd->midi[5]);
- write_pfv(p, pfv_midi7, frd->midi[6]);
- write_pfv(p, pfv_midi8, frd->midi[7]);
}
static void set_frd_from_pfv(struct patch *p, struct frame_descriptor *frd)
View
4 src/renderer/framedescriptor.h
@@ -1,6 +1,6 @@
/*
* Flickernoise
- * Copyright (C) 2010, 2011 Sebastien Bourdeauducq
+ * Copyright (C) 2010, 2011, 2012 Sebastien Bourdeauducq
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -41,7 +41,6 @@ enum {
#define IDMX_COUNT 8
#define OSC_COUNT 4
-#define MIDI_COUNT 8
#define DMX_COUNT 8
#define IMAGE_COUNT 2
@@ -55,7 +54,6 @@ struct frame_descriptor {
float bass_att, mid_att, treb_att;
float idmx[IDMX_COUNT];
float osc[OSC_COUNT];
- float midi[MIDI_COUNT];
float decay;
float wave_mode;
View
27 src/renderer/sampler.c
@@ -82,18 +82,6 @@ static void get_dmx_variables(int fd, float *out)
}
}
-static int midi_channel;
-static int midi_map[MIDI_COUNT];
-static int midi_controllers[129];
-
-static void get_midi_variables(float *out)
-{
- int i;
-
- for(i=0;i<MIDI_COUNT;i++)
- out[i] = ((float)midi_controllers[midi_map[i]])/127.0;
-}
-
static rtems_id returned_q;
static rtems_id sampler_terminated;
@@ -195,10 +183,9 @@ static rtems_task sampler_task(rtems_task_argument argument)
recorded_descriptor->frame = frame++;
recorded_descriptor->time = time;
time += 1.0/FPS;
- /* Get DMX/OSC/MIDI inputs */
+ /* Get DMX/OSC inputs */
get_dmx_variables(dmx_fd, recorded_descriptor->idmx);
get_osc_variables(recorded_descriptor->osc);
- get_midi_variables(recorded_descriptor->midi);
/* Update status and send downstream */
recorded_descriptor->status = FRD_STATUS_SAMPLED;
callback(recorded_descriptor);
@@ -271,8 +258,6 @@ static void midi_ctrl_event(struct patch *p, mtk_event *e)
ctrl = (e->press.code & 0x7f00) >> 8;
value = e->press.code & 0x7f;
- if(chan == midi_channel)
- midi_controllers[ctrl] = value;
if(p)
stim_midi_ctrl(p->stim, chan+1, ctrl, value);
}
@@ -289,8 +274,7 @@ static void midi_pitch_event(mtk_event *e)
chan = (e->press.code & 0x0f0000) >> 16;
value = e->press.code & 0x7f;
- if(chan == midi_channel)
- midi_controllers[128] = value;
+ // TODO
}
static void event_callback(mtk_event *e, int count)
@@ -324,13 +308,6 @@ void sampler_start(frd_callback callback)
sprintf(confname, "idmx%d", i+1);
idmx_map[i] = config_read_int(confname, i+1)-1;
}
- midi_channel = config_read_int("midi_channel", 0);
- for(i=0;i<MIDI_COUNT;i++) {
- sprintf(confname, "midi%d", i+1);
- midi_map[i] = config_read_int(confname, i);
- if((midi_map[i] < 0) || (midi_map[i] > 128))
- midi_map[i] = i;
- }
sc = rtems_message_queue_create(
rtems_build_name('S', 'M', 'P', 'L'),
View
5 src/translations/french.c
@@ -1,6 +1,6 @@
/*
* Flickernoise
- * Copyright (C) 2011 Sebastien Bourdeauducq
+ * Copyright (C) 2011, 2012 Sebastien Bourdeauducq
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -96,9 +96,8 @@ struct mtk_i18n_entry translation_french[] = {
// MIDI settings
{ "MIDI settings", "Param\xe8""tres MIDI" },
{ "Global parameters", "Param\xe8""tres globaux" },
- { "Channel (1-16):", "Canal (1-16) :" },
+ { "Patch switch channel (1-16):", "Canal de s\xe9""lection de patch (1-16) :" },
{ "Note:", "Note :" },
- { "Controller mapping", "Connexion des contr\xf4""leurs" },
{ "Latest active controller:", "Dernier contr\xf4""leur actif :" },
{ "Select MIDI patch", "S\xe9""lection du patch MIDI" },

0 comments on commit dde38d1

Please sign in to comment.
Something went wrong with that request. Please try again.