Skip to contentSkip to conversation

envy24control: enhanced mapping of midi controller

PATCH Applied Dirk Jagdmann 2 participants 2 messages Jul 30, 2005 – Aug 3, 2005

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 envy24control: enhanced mapping of midi controller

Hello,

this patch adds a command line option to select a better mapping from midi controller values to dB sliders. The default stays as a linear mapping, which has the disadvantage, that a sensible area to adjust your volume (which ist mostly in the range of 0..-12dB) is in the upper 1/10th of your midi controller. This patch adds a map, which consists of two linear functions, so that the upper half of your midi controller controls values from 0..-12dB, the lower half then controls -13..-96dB.

Signature · 3 lines
---> doj / cubic
----> http://cubic.org/~doj
-----> http://llg.cubic.org

Index: envy24control.1
===================================================================
RCS file: /cvsroot/alsa/alsa-tools/envy24control/envy24control.1,v retrieving revision 1.9

envy24control.1 +6 -3
diff -u -r1.9 envy24control.1
@@ -1,10 +1,10 @@
-.TH "envy24control" "1" "16 May 2004" "" ""
+.TH "envy24control" "1" "30 July 2005" "" ""
 .SH "NAME"
 envy24control \- GUI control tool for Envy24 (ice1712) based
 soundcards, under ALSA.
 
 .SH "SYNOPSIS"
-\fBenvy24control\fP [\fI\-c\fP card\-number] [\fI\-D\fP control\-name] [\fI\-o\fP 0\-num DACs max 8] [\fI\-i\fP 0\-num ADCs max 8] [\fI\-p\fP 0\-8] [\fI\-s\fP 0\-2] [\fI\-f\fP <profiles file name>] [\fI\-v\fP] [<profile number>|<profile name>] [\fI\-m\fP midi\-channel]
+\fBenvy24control\fP [\fI\-c\fP card\-number] [\fI\-D\fP control\-name] [\fI\-o\fP 0\-num DACs max 8] [\fI\-i\fP 0\-num ADCs max 8] [\fI\-p\fP 0\-8] [\fI\-s\fP 0\-2] [\fI\-f\fP <profiles file name>] [\fI\-v\fP] [<profile number>|<profile name>] [\fI\-m\fP midi\-channel] [\fI\-M\fP]
 
 .SH "DESCRIPTION"
 \fBenvy24control\fP allows control of the digital mixer, channel gains
@@ -13,7 +13,7 @@
 displays a level meter for each input and output channel.
 
 .SH "INVOKING"
-\fBenvy24control\fP [\fI\-c\fP card\-number] [\fI\-D\fP control\-name] [\fI\-o\fP 0\-num DACs max 8] [\fI\-i\fP 0\-num ADCs max 8] [\fI\-p\fP 0\-8] [\fI\-s\fP 0\-2] [\fI\-f\fP <profiles file name>] [\fI\-v\fP] [<profile number>|<profile name>] [\fI\-m\fP midi\-channel]
+\fBenvy24control\fP [\fI\-c\fP card\-number] [\fI\-D\fP control\-name] [\fI\-o\fP 0\-num DACs max 8] [\fI\-i\fP 0\-num ADCs max 8] [\fI\-p\fP 0\-8] [\fI\-s\fP 0\-2] [\fI\-f\fP <profiles file name>] [\fI\-v\fP] [<profile number>|<profile name>] [\fI\-m\fP midi\-channel] [\fI\-M\fP]
 .TP 
 If no control\-name is given, then the first sound card is used.
 
@@ -62,6 +62,9 @@
 Use MIDI controller values to control the Faders in the mixer view.
 The application will react to controllers on channel midi\-channel and
 send controllers on this channel when the user moves the GUI sliders.
+.TP 
+\fI\-M\fP
+Use an enhanced mapping from midi controller values to db sliders.
 .SH "SEE ALSO"
 \fB
 alsamixer(1),

Index: envy24control.c
===================================================================
RCS file: /cvsroot/alsa/alsa-tools/envy24control/envy24control.c,v retrieving revision 1.35

envy24control.c +5 -3
diff -u -r1.35 envy24control.c
@@ -1951,7 +1951,7 @@
 	snd_ctl_elem_value_t *val;
 	int npfds;
 	struct pollfd *pfds;
-	int midi_fd = -1, midi_channel = -1;
+	int midi_fd = -1, midi_channel = -1, midi_enhanced = 0;
 	int page;
 	int input_channels_set = 0;
 	int output_channels_set = 0;
@@ -1961,6 +1961,7 @@
 		{"profiles_file", 1, 0, 'f'},
 		{"inputs", 1, 0, 'i'},
 		{"midichannel", 1, 0, 'm'},
+		{"midienhanced", 0, 0, 'M'},
 		{"outputs", 1, 0, 'o'},
 		{"pcm_outputs", 1, 0, 'p'},
 		{"spdif", 1, 0, 's'},
@@ -1984,7 +1985,7 @@
 	view_spdif_playback = 0;
 	profiles_file_name = DEFAULT_PROFILERC;
 	default_profile = NULL;
-	while ((c = getopt_long(argc, argv, "D:c:f:i:m:o:p:s:v", long_options, NULL)) != -1) {
+	while ((c = getopt_long(argc, argv, "D:c:f:i:m:Mo:p:s:v", long_options, NULL)) != -1) {
 		switch (c) {
 		case 'D':
 			name = optarg;
@@ -2023,6 +2024,7 @@
 			}
 			--midi_channel;
 			break;
+		case 'M': midi_enhanced = 1; break;
 		case 'o':
 			output_channels = atoi(optarg);
 			if (output_channels < 0 || output_channels > MAX_OUTPUT_CHANNELS) {
@@ -2122,7 +2124,7 @@
 	hardware_init();
 	analog_volume_init();
 	if (midi_channel >= 0)
-		midi_fd = midi_init(argv[0], midi_channel);
+		midi_fd = midi_init(argv[0], midi_channel, midi_enhanced);
 
 	fprintf(stderr, "using\t --- input_channels: %i\n\t --- output_channels: %i\n\t --- pcm_output_channels: %i\n\t --- spdif in/out channels: %i\n", \
 		input_channels, output_channels, pcm_output_channels, spdif_channels);

Index: midi.c
===================================================================
RCS file: /cvsroot/alsa/alsa-tools/envy24control/midi.c,v retrieving revision 1.3

midi.c +141 -8

187 lines not on this page · raw message

Index: midi.h
===================================================================
RCS file: /cvsroot/alsa/alsa-tools/envy24control/midi.h,v retrieving revision 1.2

midi.h +1 -1
diff -u -r1.2 midi.h
@@ -3,7 +3,7 @@
 
 #include <gdk/gdk.h>
 
-int midi_init(char *appname, int channel);
+int midi_init(char *appname, int channel, int midi_enhanced);
 int midi_close();
 void midi_maxstreams(int);
 int midi_controller(int c, int v);
Applied
#1 lore raw

At Sat, 30 Jul 2005 16:18:49 +0200,

Quoted 10 lines · Dirk Jagdmann

Hello,

this patch adds a command line option to select a better mapping from midi controller values to dB sliders. The default stays as a linear mapping, which has the disadvantage, that a sensible area to adjust your volume (which ist mostly in the range of 0..-12dB) is in the upper 1/10th of your midi controller. This patch adds a map, which consists of two linear functions, so that the upper half of your midi controller controls values from 0..-12dB, the lower half then controls -13..-96dB.

Applied to CVS tree. Thanks!

Takashi

-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies from IBM. Find simple to follow Roadmaps, straightforward articles, informative Webcasts and more! Get everything you need to get up to speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click