View Issue Details
| ID | Project | Category | View Status | Date Submitted | Last Update |
|---|---|---|---|---|---|
| 0004949 | ardour | features | public | 2012-06-25 14:57 | 2020-04-19 20:16 |
| Reporter | royvegard | Assigned To | cth103 | ||
| Priority | normal | Severity | feature | Reproducibility | N/A |
| Status | closed | Resolution | fixed | ||
| Target Version | 3.0 | ||||
| Summary | 0004949: [PATCH] set-bank midifunction | ||||
| Description | This patch add a new midifunction "set-bank", that can be mapped to a midi input. It also includes changes to the Korg_nanoKONTROL.map binding file, to show an example of how to use set-bank. | ||||
| Tags | Midi | ||||
|
2012-06-25 14:58
|
4949.patch (9,251 bytes)
diff --git a/libs/surfaces/generic_midi/midifunction.cc b/libs/surfaces/generic_midi/midifunction.cc
index 302ed0b..70e9337 100644
--- a/libs/surfaces/generic_midi/midifunction.cc
+++ b/libs/surfaces/generic_midi/midifunction.cc
@@ -61,6 +61,11 @@ MIDIFunction::setup (GenericMidiControlProtocol& ui, const std::string& invokabl
_function = NextBank;
} else if (strcasecmp (_invokable_name.c_str(), "prev-bank") == 0) {
_function = PrevBank;
+ } else if (strcasecmp (_invokable_name.c_str(), "set-bank") == 0) {
+ if (_argument.empty()) {
+ return -1;
+ }
+ _function = SetBank;
} else if (strcasecmp (_invokable_name.c_str(), "select") == 0) {
if (_argument.empty()) {
return -1;
@@ -95,6 +100,14 @@ MIDIFunction::execute ()
_ui->prev_bank();
break;
+ case SetBank:
+ if (!_argument.empty()) {
+ uint32_t bank;
+ sscanf (_argument.c_str(), "%d", &bank);
+ _ui->set_current_bank (bank);
+ }
+ break;
+
case TransportStop:
_ui->transport_stop ();
break;
diff --git a/libs/surfaces/generic_midi/midifunction.h b/libs/surfaces/generic_midi/midifunction.h
index 8b3a52d..8f0b021 100644
--- a/libs/surfaces/generic_midi/midifunction.h
+++ b/libs/surfaces/generic_midi/midifunction.h
@@ -55,6 +55,7 @@ class MIDIFunction : public MIDIInvokable
TransportRecordDisable,
/* 1 argument functions: RID */
Select,
+ SetBank,
/* 2 argument functions: RID, value */
TrackSetSolo,
TrackSetMute,
diff --git a/midi_maps/Korg_nanoKONTROL.map b/midi_maps/Korg_nanoKONTROL.map
index 17a07f6..80c76a8 100644
--- a/midi_maps/Korg_nanoKONTROL.map
+++ b/midi_maps/Korg_nanoKONTROL.map
@@ -2,81 +2,65 @@
<ArdourMIDIBindings version="1.0.0" name="Korg nanoKONTROL">
<!-- 2010-11-26 Chooch Schubert: Map file creation -->
- <DeviceInfo bank-size="9"/>
+ <DeviceInfo bank-size="9" motorized="no" threshold="15"/>
<!-- Transport Controls -->
<Binding channel="1" ctl="44" function="rec-enable"/>
- <Binding channel="1" ctl="44" function="rec-disable"/>
+ <Binding channel="1" ctl="46" function="rec-disable"/>
<Binding channel="1" ctl="45" function="transport-roll"/>
<Binding channel="1" ctl="46" function="transport-stop"/>
<Binding channel="1" ctl="47" function="transport-start"/>
<Binding channel="1" ctl="48" function="transport-end"/>
<Binding channel="1" ctl="49" function="loop-toggle"/>
-<!-- The "Scene" button toggles between four banks. It implements this by -->
-<!-- changing the midi codes that are sent on each channel control, so when -->
-<!-- you hit the Scene button the nanKONTROL will send different midi codes -->
-<!-- for each button. Scene 1 is faders 1-9, Scene 2 is faders 10-19, etc. -->
-<!-- This essentially duplicates Ardours Bank feature. Because Ardour is -->
-<!-- more flexible, I have chosen to map all of the Scene button states to -->
-<!-- Ardours "next-bank" function. -->
-<!-- -->
-<!-- The drawback is that the indicator LED may be incorrect in the Scene -->
-<!-- or Bank number indicated (ie: you could be on Ardour Bank 5, but the -->
-<!-- LED for Scene 1 will be lit up). If this bother you, then you can -->
-<!-- comment out the following four lines. This will enable you to use the -->
-<!-- controllers built in Scenes (possibility of 36 tracks), but you will -->
-<!-- have to use a mouse to change banks in the Ardour GUI -->
-<Binding sysex="f0 42 40 0 1 4 0 5f 4f 0 f7" function="next-bank"/>
-<Binding sysex="f0 42 40 0 1 4 0 5f 4f 1 f7" function="next-bank"/>
-<Binding sysex="f0 42 40 0 1 4 0 5f 4f 2 f7" function="next-bank"/>
-<Binding sysex="f0 42 40 0 1 4 0 5f 4f 3 f7" function="next-bank"/>
+<!-- The "Scene" button toggles between four banks. For this to work as -->
+<!-- intended, you have to configure all four scenes to be identical. -->
+<Binding sysex="f0 42 40 0 1 4 0 5f 4f 0 f7" function="set-bank" argument="0"/>
+<Binding sysex="f0 42 40 0 1 4 0 5f 4f 1 f7" function="set-bank" argument="1"/>
+<Binding sysex="f0 42 40 0 1 4 0 5f 4f 2 f7" function="set-bank" argument="2"/>
+<Binding sysex="f0 42 40 0 1 4 0 5f 4f 3 f7" function="set-bank" argument="3"/>
<!-- Channel controls: -->
<!-- - The two buttons on each channel are unmarked. I decided to use them -->
<!-- as "Solo" and "Record Enable". -->
-<!-- - Channel pan is not yet implemented in Ardour-3, so I chose to map -->
-<!-- the rotary controls as "Send Gain" which will adjust the volume of -->
-<!-- the first send on each channel, if one exists. When Ardour -->
-<!-- impliments panning this will likely be changed, since I feel -->
-<!-- panning is more useful. -->
- <Binding channel="1" ctl="2" uri="/route/gain B1"/>
- <Binding channel="1" ctl="3" uri="/route/gain B2"/>
- <Binding channel="1" ctl="4" uri="/route/gain B3"/>
- <Binding channel="1" ctl="5" uri="/route/gain B4"/>
- <Binding channel="1" ctl="6" uri="/route/gain B5"/>
- <Binding channel="1" ctl="8" uri="/route/gain B6"/>
- <Binding channel="1" ctl="9" uri="/route/gain B7"/>
- <Binding channel="1" ctl="12" uri="/route/gain B8"/>
- <Binding channel="1" ctl="13" uri="/route/gain B9"/>
+<!-- - The rotary controls are bound to pandirection. -->
+ <Binding channel="1" ctl="2" uri="/route/gain B2"/>
+ <Binding channel="1" ctl="3" uri="/route/gain B3"/>
+ <Binding channel="1" ctl="4" uri="/route/gain B4"/>
+ <Binding channel="1" ctl="5" uri="/route/gain B5"/>
+ <Binding channel="1" ctl="6" uri="/route/gain B6"/>
+ <Binding channel="1" ctl="8" uri="/route/gain B7"/>
+ <Binding channel="1" ctl="9" uri="/route/gain B8"/>
+ <Binding channel="1" ctl="12" uri="/route/gain B9"/>
+ <Binding channel="1" ctl="13" uri="/route/gain B10"/>
- <Binding channel="1" ctl="23" uri="/route/solo B1"/>
- <Binding channel="1" ctl="33" uri="/route/recenable B1"/>
- <Binding channel="1" ctl="24" uri="/route/solo B2"/>
- <Binding channel="1" ctl="34" uri="/route/recenable B2"/>
- <Binding channel="1" ctl="25" uri="/route/solo B3"/>
- <Binding channel="1" ctl="35" uri="/route/recenable B3"/>
- <Binding channel="1" ctl="26" uri="/route/solo B4"/>
- <Binding channel="1" ctl="36" uri="/route/recenable B4"/>
- <Binding channel="1" ctl="27" uri="/route/solo B5"/>
- <Binding channel="1" ctl="37" uri="/route/recenable B5"/>
- <Binding channel="1" ctl="28" uri="/route/solo B6"/>
- <Binding channel="1" ctl="38" uri="/route/recenable B6"/>
- <Binding channel="1" ctl="29" uri="/route/solo B7"/>
- <Binding channel="1" ctl="39" uri="/route/recenable B7"/>
- <Binding channel="1" ctl="30" uri="/route/solo B8"/>
- <Binding channel="1" ctl="40" uri="/route/recenable B8"/>
- <Binding channel="1" ctl="31" uri="/route/solo B9"/>
- <Binding channel="1" ctl="41" uri="/route/recenable B9"/>
+ <Binding channel="1" ctl="23" uri="/route/solo B2"/>
+ <Binding channel="1" ctl="33" uri="/route/recenable B2"/>
+ <Binding channel="1" ctl="24" uri="/route/solo B3"/>
+ <Binding channel="1" ctl="34" uri="/route/recenable B3"/>
+ <Binding channel="1" ctl="25" uri="/route/solo B4"/>
+ <Binding channel="1" ctl="35" uri="/route/recenable B4"/>
+ <Binding channel="1" ctl="26" uri="/route/solo B5"/>
+ <Binding channel="1" ctl="36" uri="/route/recenable B5"/>
+ <Binding channel="1" ctl="27" uri="/route/solo B6"/>
+ <Binding channel="1" ctl="37" uri="/route/recenable B6"/>
+ <Binding channel="1" ctl="28" uri="/route/solo B7"/>
+ <Binding channel="1" ctl="38" uri="/route/recenable B7"/>
+ <Binding channel="1" ctl="29" uri="/route/solo B8"/>
+ <Binding channel="1" ctl="39" uri="/route/recenable B8"/>
+ <Binding channel="1" ctl="30" uri="/route/solo B9"/>
+ <Binding channel="1" ctl="40" uri="/route/recenable B9"/>
+ <Binding channel="1" ctl="31" uri="/route/solo B10"/>
+ <Binding channel="1" ctl="41" uri="/route/recenable B10"/>
- <Binding channel="1" ctl="14" uri="/route/send/gain B1"/>
- <Binding channel="1" ctl="15" uri="/route/send/gain B2"/>
- <Binding channel="1" ctl="16" uri="/route/send/gain B3"/>
- <Binding channel="1" ctl="17" uri="/route/send/gain B4"/>
- <Binding channel="1" ctl="18" uri="/route/send/gain B5"/>
- <Binding channel="1" ctl="19" uri="/route/send/gain B6"/>
- <Binding channel="1" ctl="20" uri="/route/send/gain B7"/>
- <Binding channel="1" ctl="21" uri="/route/send/gain B8"/>
- <Binding channel="1" ctl="22" uri="/route/send/gain B9"/>
+ <Binding channel="1" ctl="14" uri="/route/pandirection B2"/>
+ <Binding channel="1" ctl="15" uri="/route/pandirection B3"/>
+ <Binding channel="1" ctl="16" uri="/route/pandirection B4"/>
+ <Binding channel="1" ctl="17" uri="/route/pandirection B5"/>
+ <Binding channel="1" ctl="18" uri="/route/pandirection B6"/>
+ <Binding channel="1" ctl="19" uri="/route/pandirection B7"/>
+ <Binding channel="1" ctl="20" uri="/route/pandirection B8"/>
+ <Binding channel="1" ctl="21" uri="/route/pandirection B9"/>
+ <Binding channel="1" ctl="22" uri="/route/pandirection B10"/>
</ArdourMIDIBindings>
|
|
2012-06-25 18:21
|
correct_rid.patch (4,729 bytes)
diff --git a/midi_maps/Korg_nanoKONTROL.map b/midi_maps/Korg_nanoKONTROL.map index 80c76a8..3acc568 100644 --- a/midi_maps/Korg_nanoKONTROL.map +++ b/midi_maps/Korg_nanoKONTROL.map @@ -24,43 +24,43 @@ <!-- - The two buttons on each channel are unmarked. I decided to use them --> <!-- as "Solo" and "Record Enable". --> <!-- - The rotary controls are bound to pandirection. --> - <Binding channel="1" ctl="2" uri="/route/gain B2"/> - <Binding channel="1" ctl="3" uri="/route/gain B3"/> - <Binding channel="1" ctl="4" uri="/route/gain B4"/> - <Binding channel="1" ctl="5" uri="/route/gain B5"/> - <Binding channel="1" ctl="6" uri="/route/gain B6"/> - <Binding channel="1" ctl="8" uri="/route/gain B7"/> - <Binding channel="1" ctl="9" uri="/route/gain B8"/> - <Binding channel="1" ctl="12" uri="/route/gain B9"/> - <Binding channel="1" ctl="13" uri="/route/gain B10"/> + <Binding channel="1" ctl="2" uri="/route/gain B1"/> + <Binding channel="1" ctl="3" uri="/route/gain B2"/> + <Binding channel="1" ctl="4" uri="/route/gain B3"/> + <Binding channel="1" ctl="5" uri="/route/gain B4"/> + <Binding channel="1" ctl="6" uri="/route/gain B5"/> + <Binding channel="1" ctl="8" uri="/route/gain B6"/> + <Binding channel="1" ctl="9" uri="/route/gain B7"/> + <Binding channel="1" ctl="12" uri="/route/gain B8"/> + <Binding channel="1" ctl="13" uri="/route/gain B9"/> - <Binding channel="1" ctl="23" uri="/route/solo B2"/> - <Binding channel="1" ctl="33" uri="/route/recenable B2"/> - <Binding channel="1" ctl="24" uri="/route/solo B3"/> - <Binding channel="1" ctl="34" uri="/route/recenable B3"/> - <Binding channel="1" ctl="25" uri="/route/solo B4"/> - <Binding channel="1" ctl="35" uri="/route/recenable B4"/> - <Binding channel="1" ctl="26" uri="/route/solo B5"/> - <Binding channel="1" ctl="36" uri="/route/recenable B5"/> - <Binding channel="1" ctl="27" uri="/route/solo B6"/> - <Binding channel="1" ctl="37" uri="/route/recenable B6"/> - <Binding channel="1" ctl="28" uri="/route/solo B7"/> - <Binding channel="1" ctl="38" uri="/route/recenable B7"/> - <Binding channel="1" ctl="29" uri="/route/solo B8"/> - <Binding channel="1" ctl="39" uri="/route/recenable B8"/> - <Binding channel="1" ctl="30" uri="/route/solo B9"/> - <Binding channel="1" ctl="40" uri="/route/recenable B9"/> - <Binding channel="1" ctl="31" uri="/route/solo B10"/> - <Binding channel="1" ctl="41" uri="/route/recenable B10"/> + <Binding channel="1" ctl="23" uri="/route/solo B1"/> + <Binding channel="1" ctl="33" uri="/route/recenable B1"/> + <Binding channel="1" ctl="24" uri="/route/solo B2"/> + <Binding channel="1" ctl="34" uri="/route/recenable B2"/> + <Binding channel="1" ctl="25" uri="/route/solo B3"/> + <Binding channel="1" ctl="35" uri="/route/recenable B3"/> + <Binding channel="1" ctl="26" uri="/route/solo B4"/> + <Binding channel="1" ctl="36" uri="/route/recenable B4"/> + <Binding channel="1" ctl="27" uri="/route/solo B5"/> + <Binding channel="1" ctl="37" uri="/route/recenable B5"/> + <Binding channel="1" ctl="28" uri="/route/solo B6"/> + <Binding channel="1" ctl="38" uri="/route/recenable B6"/> + <Binding channel="1" ctl="29" uri="/route/solo B7"/> + <Binding channel="1" ctl="39" uri="/route/recenable B7"/> + <Binding channel="1" ctl="30" uri="/route/solo B8"/> + <Binding channel="1" ctl="40" uri="/route/recenable B8"/> + <Binding channel="1" ctl="31" uri="/route/solo B9"/> + <Binding channel="1" ctl="41" uri="/route/recenable B9"/> - <Binding channel="1" ctl="14" uri="/route/pandirection B2"/> - <Binding channel="1" ctl="15" uri="/route/pandirection B3"/> - <Binding channel="1" ctl="16" uri="/route/pandirection B4"/> - <Binding channel="1" ctl="17" uri="/route/pandirection B5"/> - <Binding channel="1" ctl="18" uri="/route/pandirection B6"/> - <Binding channel="1" ctl="19" uri="/route/pandirection B7"/> - <Binding channel="1" ctl="20" uri="/route/pandirection B8"/> - <Binding channel="1" ctl="21" uri="/route/pandirection B9"/> - <Binding channel="1" ctl="22" uri="/route/pandirection B10"/> + <Binding channel="1" ctl="14" uri="/route/pandirection B1"/> + <Binding channel="1" ctl="15" uri="/route/pandirection B2"/> + <Binding channel="1" ctl="16" uri="/route/pandirection B3"/> + <Binding channel="1" ctl="17" uri="/route/pandirection B4"/> + <Binding channel="1" ctl="18" uri="/route/pandirection B5"/> + <Binding channel="1" ctl="19" uri="/route/pandirection B6"/> + <Binding channel="1" ctl="20" uri="/route/pandirection B7"/> + <Binding channel="1" ctl="21" uri="/route/pandirection B8"/> + <Binding channel="1" ctl="22" uri="/route/pandirection B9"/> </ArdourMIDIBindings> |
|
|
The correct_rid.patch reverts the RID to start at 1 for the mapping file. Must be applied after 4949.patch. |
|
|
Applied to SVN 12927. Thanks! |
|
|
Issue has been closed automatically, by Trigger Close Plugin. Feel free to re-open with additional information if you think the issue is not resolved. |
| Date Modified | Username | Field | Change |
|---|---|---|---|
| 2012-06-25 14:57 | royvegard | New Issue | |
| 2012-06-25 14:58 | royvegard | File Added: 4949.patch | |
| 2012-06-25 15:01 | royvegard | Tag Attached: Midi | |
| 2012-06-25 18:00 | cth103 | cost | => 0.00 |
| 2012-06-25 18:00 | cth103 | Target Version | => 3.0 |
| 2012-06-25 18:21 | royvegard | File Added: correct_rid.patch | |
| 2012-06-25 18:24 | royvegard | Note Added: 0013700 | |
| 2012-06-25 19:26 | cth103 | Note Added: 0013701 | |
| 2012-06-25 19:26 | cth103 | Status | new => resolved |
| 2012-06-25 19:26 | cth103 | Resolution | open => fixed |
| 2012-06-25 19:26 | cth103 | Assigned To | => cth103 |
| 2020-04-19 20:16 | system | Note Added: 0023092 | |
| 2020-04-19 20:16 | system | Status | resolved => closed |