Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Remove legacy midiX variables

  • Loading branch information...
commit dde38d11d8382fb420ed75f782f891da49715fa9 1 parent d1f18e8
Sébastien Bourdeauducq authored February 26, 2012
6  src/compiler/compiler.c
@@ -118,8 +118,7 @@ static void pfv_update_patch_requires(struct compiler_sc *sc, int pfv)
118 118
 		sc->p->require |= REQUIRE_DMX;
119 119
 	if(pfv >= pfv_osc1 && pfv <= pfv_osc4)
120 120
 		sc->p->require |= REQUIRE_OSC;
121  
-	if(pfv >= pfv_midi1 && pfv <= pfv_midi8)
122  
-		sc->p->require |= REQUIRE_MIDI;
  121
+	// TODO: MIDI detection
123 122
 	if(pfv == pfv_video_a)
124 123
 		sc->p->require |= REQUIRE_VIDEO;
125 124
 }
@@ -264,8 +263,7 @@ static void pvv_update_patch_requires(struct compiler_sc *sc, int pvv)
264 263
 		sc->p->require |= REQUIRE_DMX;
265 264
 	if(pvv >= pvv_osc1 && pvv <= pvv_osc4)
266 265
 		sc->p->require |= REQUIRE_OSC;
267  
-	if(pvv >= pvv_midi1 && pvv <= pvv_midi8)
268  
-		sc->p->require |= REQUIRE_MIDI;
  266
+	// TODO: MIDI detection
269 267
 }
270 268
 
271 269
 static void pvv_bind_callback(void *_sc, struct fpvm_sym *sym, int reg)
18  src/compiler/compiler.h
@@ -128,15 +128,6 @@ enum {
128 128
 	pfv_osc3,
129 129
 	pfv_osc4,
130 130
 
131  
-	pfv_midi1,
132  
-	pfv_midi2,
133  
-	pfv_midi3,
134  
-	pfv_midi4,
135  
-	pfv_midi5,
136  
-	pfv_midi6,
137  
-	pfv_midi7,
138  
-	pfv_midi8,
139  
-
140 131
 	pfv_video_a,
141 132
 
142 133
 	pfv_image1_a,
@@ -205,15 +196,6 @@ enum {
205 196
 	pvv_osc3,
206 197
 	pvv_osc4,
207 198
 
208  
-	pvv_midi1,
209  
-	pvv_midi2,
210  
-	pvv_midi3,
211  
-	pvv_midi4,
212  
-	pvv_midi5,
213  
-	pvv_midi6,
214  
-	pvv_midi7,
215  
-	pvv_midi8,
216  
-
217 199
 	COMP_PVV_COUNT /* must be last */
218 200
 };
219 201
 
9  src/compiler/fnp.ids
@@ -108,15 +108,6 @@ osc2		pfv_osc2	pvv_osc2	SF_LIVE
108 108
 osc3		pfv_osc3	pvv_osc3	SF_LIVE
109 109
 osc4		pfv_osc4	pvv_osc4	SF_LIVE
110 110
 
111  
-midi1		pfv_midi1	pvv_midi1	SF_LIVE
112  
-midi2		pfv_midi2	pvv_midi2	SF_LIVE
113  
-midi3		pfv_midi3	pvv_midi3	SF_LIVE
114  
-midi4		pfv_midi4	pvv_midi4	SF_LIVE
115  
-midi5		pfv_midi5	pvv_midi5	SF_LIVE
116  
-midi6		pfv_midi6	pvv_midi6	SF_LIVE
117  
-midi7		pfv_midi7	pvv_midi7	SF_LIVE
118  
-midi8		pfv_midi8	pvv_midi8	SF_LIVE
119  
-
120 111
 video_a		pfv_video_a	-1
121 112
 
122 113
 image1_a	pfv_image1_a	-1
110  src/gui/midi.c
... ...
@@ -1,6 +1,6 @@
1 1
 /*
2 2
  * Flickernoise
3  
- * Copyright (C) 2010, 2011 Sebastien Bourdeauducq
  3
+ * Copyright (C) 2010, 2011, 2012 Sebastien Bourdeauducq
4 4
  *
5 5
  * This program is free software: you can redistribute it and/or modify
6 6
  * it under the terms of the GNU General Public License as published by
@@ -170,7 +170,6 @@ static void load_config(void)
170 170
 	char config_key[8];
171 171
 	int i;
172 172
 	const char *val;
173  
-	int value;
174 173
 
175 174
 	mtk_cmdf(appid, "e_channel.set(-text \"%d\")",
176 175
 	    config_read_int("midi_channel", 0)+1);
@@ -182,27 +181,13 @@ static void load_config(void)
182 181
 		else
183 182
 			midi_bindings[i][0] = 0;
184 183
 	}
185  
-	for(i=0;i<MIDI_COUNT;i++) {
186  
-		sprintf(config_key, "midi%d", i+1);
187  
-		value = config_read_int(config_key, i);
188  
-		mtk_cmdf(appid, "e_midi%d.set(-text \"%d\")", i, value);
189  
-	}
190 184
 }
191 185
 
192 186
 static void set_config(void)
193 187
 {
194 188
 	char config_key[16];
195 189
 	int i;
196  
-	int value;
197  
-
198  
-	for(i=0;i<MIDI_COUNT;i++) {
199  
-		sprintf(config_key, "e_midi%d.text", i);
200  
-		value = mtk_req_i(appid, config_key);
201  
-		if((value < 0) || (value > 128))
202  
-			value = i;
203  
-		sprintf(config_key, "midi%d", i+1);
204  
-		config_write_int(config_key, value);
205  
-	}
  190
+
206 191
 	for(i=0;i<128;i++) {
207 192
 		sprintf(config_key, "midi_%02x", i);
208 193
 		if(midi_bindings[i][0] != 0)
@@ -302,8 +287,7 @@ static void midi_event(mtk_event *e, int count)
302 287
 				break;
303 288
 			case EVENT_TYPE_MIDI_PITCH:
304 289
 				/* EVENT_TYPE_MIDI_PITCH */
305  
-				controller_event(chan, 128,
306  
-				    e[i].press.code & 0x7f);
  290
+				// TODO
307 291
 				break;
308 292
 		}
309 293
 	}
@@ -366,17 +350,6 @@ static void addupdate_callback(mtk_event *e, void *arg)
366 350
 	mtk_cmd(appid, "e_filename.set(-text \"\")");
367 351
 }
368 352
 
369  
-static void press_callback(mtk_event *e, void *arg)
370  
-{
371  
-	learn = (int)arg;
372  
-	assert(learn >= 0 && learn < MIDI_COUNT);
373  
-}
374  
-
375  
-static void release_callback(mtk_event *e, void *arg)
376  
-{
377  
-	learn = -1;
378  
-}
379  
-
380 353
 static int cmpstringp(const void *p1, const void *p2)
381 354
 {
382 355
 	return strcmp(*(char * const *)p1, *(char * const *)p2);
@@ -451,29 +424,17 @@ static void autobuild_callback(mtk_event *e, void *arg)
451 424
 
452 425
 void init_midi(void)
453 426
 {
454  
-	int i;
455  
-	
456 427
 	appid = mtk_init_app("MIDI");
457 428
 
458 429
 	mtk_cmd_seq(appid,
459 430
 		"g = new Grid()",
460  
-
461  
-		"g_parameters0 = new Grid()",
462  
-		"l_parameters = new Label(-text \"Global parameters\" -font \"title\")",
463  
-		"s_parameters1 = new Separator(-vertical no)",
464  
-		"s_parameters2 = new Separator(-vertical no)",
465  
-		"g_parameters0.place(s_parameters1, -column 1 -row 1)",
466  
-		"g_parameters0.place(l_parameters, -column 2 -row 1)",
467  
-		"g_parameters0.place(s_parameters2, -column 3 -row 1)",
  431
+		 
468 432
 		"g_parameters = new Grid()",
469  
-		"l_channel = new Label(-text \"Channel (1-16):\")",
  433
+		"l_channel = new Label(-text \"Patch switch channel (1-16):\")",
470 434
 		"e_channel = new Entry()",
471 435
 		"g_parameters.place(l_channel, -column 1 -row 1)",
472 436
 		"g_parameters.place(e_channel, -column 2 -row 1)",
473  
-
474  
-		"g_sep = new Grid()",
475  
-
476  
-		"g_patch = new Grid()",
  437
+		"g.place(g_parameters, -column 1 -row 0)",
477 438
 
478 439
 		"g_existing0 = new Grid()",
479 440
 		"l_existing = new Label(-text \"Existing bindings\" -font \"title\")",
@@ -512,65 +473,34 @@ void init_midi(void)
512 473
 		"b_addupdate = new Button(-text \"Add/update\")",
513 474
 		"b_autobuild = new Button(-text \"Auto build\")",
514 475
 		
515  
-		"g_patch.place(g_existing0, -column 1 -row 1)",
516  
-		"g_patch.place(lst_existingf, -column 1 -row 2)",
517  
-		"g_patch.rowconfig(2, -size 130)",
518  
-		"g_patch.place(g_addedit0, -column 1 -row 3)",
519  
-		"g_patch.place(g_addedit1, -column 1 -row 4)",
520  
-		"g_patch.place(b_addupdate, -column 1 -row 5)",
521  
-		"g_patch.place(b_autobuild, -column 1 -row 6)",
522  
-		
523  
-		"g_var = new Grid()",
524  
-		
525  
-		"g_cmap0 = new Grid()",
526  
-		"l_cmap = new Label(-text \"Controller mapping\" -font \"title\")",
527  
-		"s_cmap1 = new Separator(-vertical no)",
528  
-		"s_cmap2 = new Separator(-vertical no)",
529  
-		"g_cmap0.place(s_cmap1, -column 1 -row 1)",
530  
-		"g_cmap0.place(l_cmap, -column 2 -row 1)",
531  
-		"g_cmap0.place(s_cmap2, -column 3 -row 1)",
532  
-		
533  
-		"g_vars = new Grid()",
534  
-		"g_vars.columnconfig(2, -size 55)",
  476
+		"g.place(g_existing0, -column 1 -row 1)",
  477
+		"g.place(lst_existingf, -column 1 -row 2)",
  478
+		"g.rowconfig(2, -size 130)",
  479
+		"g.place(g_addedit0, -column 1 -row 3)",
  480
+		"g.place(g_addedit1, -column 1 -row 4)",
  481
+		"g.place(b_addupdate, -column 1 -row 5)",
  482
+		"g.place(b_autobuild, -column 1 -row 6)",
535 483
 		
  484
+		"g_lastctl = new Grid()",
536 485
 		"l_lastctltxt = new Label(-text \"Latest active controller:\")",
537 486
 		"l_lastctl = new Label()",
538  
-		
539  
-		"g_var.place(g_cmap0, -column 1 -row 1)",
540  
-		"g_var.place(g_vars, -column 1 -row 2)",
541  
-		"g_var.place(l_lastctltxt, -column 1 -row 3)",
542  
-		"g_var.place(l_lastctl, -column 1 -row 4)",
543  
-
544  
-		"g_sep.place(g_patch, -column 1 -row 1)",
545  
-		"sep = new Separator(-vertical yes)",
546  
-		"g_sep.place(sep, -column 2 -row 1)",
547  
-		"g_sep.place(g_var, -column 3 -row 1)",
  487
+		"g_lastctl.place(l_lastctltxt, -column 1 -row 1)",
  488
+		"g_lastctl.place(l_lastctl, -column 2 -row 1)",
  489
+		"g.place(g_lastctl, -column 1 -row 7)",
548 490
 		
549 491
 		"g_btn = new Grid()",
550 492
 		"b_ok = new Button(-text \"OK\")",
551 493
 		"b_cancel = new Button(-text \"Cancel\")",
552  
-		"g_btn.columnconfig(1, -size 450)",
  494
+		"g_btn.columnconfig(1, -size 250)",
553 495
 		"g_btn.place(b_ok, -column 2 -row 1)",
554 496
 		"g_btn.place(b_cancel, -column 3 -row 1)",
555 497
 
556  
-		"g.place(g_parameters0, -column 1 -row 1)",
557  
-		"g.place(g_parameters, -column 1 -row 2)",
558  
-		"g.place(g_sep, -column 1 -row 3)",
559  
-		"g.rowconfig(4, -size 10)",
560  
-		"g.place(g_btn, -column 1 -row 5)",
  498
+		"g.rowconfig(8, -size 10)",
  499
+		"g.place(g_btn, -column 1 -row 9)",
561 500
 
562 501
 		"w = new Window(-content g -title \"MIDI settings\" -workx 10)",
563 502
 		0);
564 503
 
565  
-	for(i=0;i<MIDI_COUNT;i++) {
566  
-		mtk_cmdf(appid, "l_midi%d = new Label(-text \"\emidi%d\")", i, i+1);
567  
-		mtk_cmdf(appid, "e_midi%d = new Entry()", i);
568  
-		mtk_cmdf(appid, "g_vars.place(l_midi%d, -column 1 -row %d)", i, i);
569  
-		mtk_cmdf(appid, "g_vars.place(e_midi%d, -column 2 -row %d)", i, i);
570  
-		mtk_bindf(appid, "l_midi%d", "press", press_callback, (void *)i, i);
571  
-		mtk_bindf(appid, "l_midi%d", "release", release_callback, NULL, i);
572  
-	}
573  
-
574 504
 	mtk_bind(appid, "lst_existing", "selchange", selchange_callback, NULL);
575 505
 	mtk_bind(appid, "lst_existing", "selcommit", selchange_callback, NULL);
576 506
 	mtk_bind(appid, "b_filename", "commit", browse_callback, NULL);
14  src/gui/monitor.c
... ...
@@ -1,6 +1,6 @@
1 1
 /*
2 2
  * Flickernoise
3  
- * Copyright (C) 2010, 2011 Sebastien Bourdeauducq
  3
+ * Copyright (C) 2010, 2011, 2012 Sebastien Bourdeauducq
4 4
  *
5 5
  * This program is free software: you can redistribute it and/or modify
6 6
  * it under the terms of the GNU General Public License as published by
@@ -36,7 +36,6 @@ static float bass, mid, treb;
36 36
 static float bass_att, mid_att, treb_att;
37 37
 static float idmx[IDMX_COUNT];
38 38
 static float osc[OSC_COUNT];
39  
-static float midi[MIDI_COUNT];
40 39
 
41 40
 static void sampler_callback(struct frame_descriptor *frd)
42 41
 {
@@ -57,8 +56,6 @@ static void sampler_callback(struct frame_descriptor *frd)
57 56
 		idmx[i] = frd->idmx[i];
58 57
 	for(i=0;i<OSC_COUNT;i++)
59 58
 		osc[i] = frd->osc[i];
60  
-	for(i=0;i<MIDI_COUNT;i++)
61  
-		midi[i] = frd->midi[i];
62 59
 	sampler_return(frd);
63 60
 }
64 61
 
@@ -88,15 +85,6 @@ static float *get_variable(const char *name)
88 85
 	else if(strcmp(name, "osc2") == 0) return &osc[1];
89 86
 	else if(strcmp(name, "osc3") == 0) return &osc[2];
90 87
 	else if(strcmp(name, "osc4") == 0) return &osc[3];
91  
-	
92  
-	else if(strcmp(name, "midi1") == 0) return &midi[0];
93  
-	else if(strcmp(name, "midi2") == 0) return &midi[1];
94  
-	else if(strcmp(name, "midi3") == 0) return &midi[2];
95  
-	else if(strcmp(name, "midi4") == 0) return &midi[3];
96  
-	else if(strcmp(name, "midi5") == 0) return &midi[4];
97  
-	else if(strcmp(name, "midi6") == 0) return &midi[5];
98  
-	else if(strcmp(name, "midi7") == 0) return &midi[6];
99  
-	else if(strcmp(name, "midi8") == 0) return &midi[7];
100 88
 
101 89
 	else return NULL;
102 90
 }
18  src/renderer/eval.c
@@ -106,15 +106,6 @@ static void transfer_pvv_regs(struct patch *p)
106 106
 	write_pvv(p, pvv_osc2, read_pfv(p, pfv_osc2));
107 107
 	write_pvv(p, pvv_osc3, read_pfv(p, pfv_osc3));
108 108
 	write_pvv(p, pvv_osc4, read_pfv(p, pfv_osc4));
109  
-	
110  
-	write_pvv(p, pvv_midi1, read_pfv(p, pfv_midi1));
111  
-	write_pvv(p, pvv_midi2, read_pfv(p, pfv_midi2));
112  
-	write_pvv(p, pvv_midi3, read_pfv(p, pfv_midi3));
113  
-	write_pvv(p, pvv_midi4, read_pfv(p, pfv_midi4));
114  
-	write_pvv(p, pvv_midi5, read_pfv(p, pfv_midi5));
115  
-	write_pvv(p, pvv_midi6, read_pfv(p, pfv_midi6));
116  
-	write_pvv(p, pvv_midi7, read_pfv(p, pfv_midi7));
117  
-	write_pvv(p, pvv_midi8, read_pfv(p, pfv_midi8));
118 109
 }
119 110
 
120 111
 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)
158 149
 	write_pfv(p, pfv_osc2, frd->osc[1]);
159 150
 	write_pfv(p, pfv_osc3, frd->osc[2]);
160 151
 	write_pfv(p, pfv_osc4, frd->osc[3]);
161  
-	
162  
-	write_pfv(p, pfv_midi1, frd->midi[0]);
163  
-	write_pfv(p, pfv_midi2, frd->midi[1]);
164  
-	write_pfv(p, pfv_midi3, frd->midi[2]);
165  
-	write_pfv(p, pfv_midi4, frd->midi[3]);
166  
-	write_pfv(p, pfv_midi5, frd->midi[4]);
167  
-	write_pfv(p, pfv_midi6, frd->midi[5]);
168  
-	write_pfv(p, pfv_midi7, frd->midi[6]);
169  
-	write_pfv(p, pfv_midi8, frd->midi[7]);
170 152
 }
171 153
 
172 154
 static void set_frd_from_pfv(struct patch *p, struct frame_descriptor *frd)
4  src/renderer/framedescriptor.h
... ...
@@ -1,6 +1,6 @@
1 1
 /*
2 2
  * Flickernoise
3  
- * Copyright (C) 2010, 2011 Sebastien Bourdeauducq
  3
+ * Copyright (C) 2010, 2011, 2012 Sebastien Bourdeauducq
4 4
  *
5 5
  * This program is free software: you can redistribute it and/or modify
6 6
  * it under the terms of the GNU General Public License as published by
@@ -41,7 +41,6 @@ enum {
41 41
 
42 42
 #define IDMX_COUNT	8
43 43
 #define OSC_COUNT	4
44  
-#define MIDI_COUNT	8
45 44
 #define DMX_COUNT	8
46 45
 #define IMAGE_COUNT	2
47 46
 
@@ -55,7 +54,6 @@ struct frame_descriptor {
55 54
 	float bass_att, mid_att, treb_att;
56 55
 	float idmx[IDMX_COUNT];
57 56
 	float osc[OSC_COUNT];
58  
-	float midi[MIDI_COUNT];
59 57
 
60 58
 	float decay;
61 59
 	float wave_mode;
27  src/renderer/sampler.c
@@ -82,18 +82,6 @@ static void get_dmx_variables(int fd, float *out)
82 82
 	}
83 83
 }
84 84
 
85  
-static int midi_channel;
86  
-static int midi_map[MIDI_COUNT];
87  
-static int midi_controllers[129];
88  
-
89  
-static void get_midi_variables(float *out)
90  
-{
91  
-	int i;
92  
-	
93  
-	for(i=0;i<MIDI_COUNT;i++)
94  
-		out[i] = ((float)midi_controllers[midi_map[i]])/127.0;
95  
-}
96  
-
97 85
 static rtems_id returned_q;
98 86
 static rtems_id sampler_terminated;
99 87
 
@@ -195,10 +183,9 @@ static rtems_task sampler_task(rtems_task_argument argument)
195 183
 		recorded_descriptor->frame = frame++;
196 184
 		recorded_descriptor->time = time;
197 185
 		time += 1.0/FPS;
198  
-		/* Get DMX/OSC/MIDI inputs */
  186
+		/* Get DMX/OSC inputs */
199 187
 		get_dmx_variables(dmx_fd, recorded_descriptor->idmx);
200 188
 		get_osc_variables(recorded_descriptor->osc);
201  
-		get_midi_variables(recorded_descriptor->midi);
202 189
 		/* Update status and send downstream */
203 190
 		recorded_descriptor->status = FRD_STATUS_SAMPLED;
204 191
 		callback(recorded_descriptor);
@@ -271,8 +258,6 @@ static void midi_ctrl_event(struct patch *p, mtk_event *e)
271 258
 	ctrl = (e->press.code & 0x7f00) >> 8;
272 259
 	value = e->press.code & 0x7f;
273 260
 
274  
-	if(chan == midi_channel)
275  
-		midi_controllers[ctrl] = value;
276 261
 	if(p)
277 262
 		stim_midi_ctrl(p->stim, chan+1, ctrl, value);
278 263
 }
@@ -289,8 +274,7 @@ static void midi_pitch_event(mtk_event *e)
289 274
 	chan = (e->press.code & 0x0f0000) >> 16;
290 275
 	value = e->press.code & 0x7f;
291 276
 
292  
-	if(chan == midi_channel)
293  
-		midi_controllers[128] = value;
  277
+	// TODO
294 278
 }
295 279
 
296 280
 static void event_callback(mtk_event *e, int count)
@@ -324,13 +308,6 @@ void sampler_start(frd_callback callback)
324 308
 		sprintf(confname, "idmx%d", i+1);
325 309
 		idmx_map[i] = config_read_int(confname, i+1)-1;
326 310
 	}
327  
-	midi_channel = config_read_int("midi_channel", 0);
328  
-	for(i=0;i<MIDI_COUNT;i++) {
329  
-		sprintf(confname, "midi%d", i+1);
330  
-		midi_map[i] = config_read_int(confname, i);
331  
-		if((midi_map[i] < 0) || (midi_map[i] > 128))
332  
-			midi_map[i] = i;
333  
-	}
334 311
 
335 312
 	sc = rtems_message_queue_create(
336 313
 		rtems_build_name('S', 'M', 'P', 'L'),
5  src/translations/french.c
... ...
@@ -1,6 +1,6 @@
1 1
 /*
2 2
  * Flickernoise
3  
- * Copyright (C) 2011 Sebastien Bourdeauducq
  3
+ * Copyright (C) 2011, 2012 Sebastien Bourdeauducq
4 4
  *
5 5
  * This program is free software: you can redistribute it and/or modify
6 6
  * it under the terms of the GNU General Public License as published by
@@ -96,9 +96,8 @@ struct mtk_i18n_entry translation_french[] = {
96 96
 	// MIDI settings
97 97
 	{ "MIDI settings",					"Param\xe8""tres MIDI" },
98 98
 	{ "Global parameters",					"Param\xe8""tres globaux" },
99  
-	{ "Channel (1-16):",					"Canal (1-16) :" },
  99
+	{ "Patch switch channel (1-16):",			"Canal de s\xe9""lection de patch (1-16) :" },
100 100
 	{ "Note:",						"Note :" },
101  
-	{ "Controller mapping",					"Connexion des contr\xf4""leurs" },
102 101
 	{ "Latest active controller:",				"Dernier contr\xf4""leur actif :" },
103 102
 	{ "Select MIDI patch",					"S\xe9""lection du patch MIDI" },
104 103
 	

0 notes on commit dde38d1

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