us428control 0.4.5

- A new command line option indicates which interface model is actually
present (-m us428|us224|mixxx) -- nb. the mixxx mode is actually
orthogonal to the us428 and us224 ones, which are in turn both mutually
exclusive, so that more than one -m option can be specified in the same
command line, for compatibility sake; default to us428 mode, of course.

- New BANK switching allows for mapping to a maximum of 32 (!) logical
channel-tracks. This introduces effective BANK L/R button functionality.
Under the default us428 mode it now offers a total of 4 switchable banks
(or layers) for the available 8 fader-channels; while in the new us224
mode, one can switch across 8 banks of 4 fader-channels each. Each
fader-channel maps sequentially (0-31) to a logical track in your DAW,
when connected in a MMC closed-loop. This only applies when not in INPUT
MONITOR mode.

- SELECT, REC, MUTE and SOLO state LEDs/buttons/channel functionality
are now split into INPUT MONITOR and BANK modes, so that each bank
(layer) has its own state. INPUT MONITOR mode gets its own independent
state, which is the only that affects the audio interface channel signal
volume (via respective faders) through the internal hardware mixer --
nb. this special mode deals exclusively to channel/faders 0 and 1 (A/B)
and eventually to 2 and 3 (C/D) which are only available on the US-428
and made accessible through modprobe'ing snd-usb-usx2y with nrpacks=1
and thus made usable via the special hwdep "rawusb" interface mode (ie.
hw:N,2).

- The new track-channel mapping gets effectively signaled through
correspondent but rather experimental MMC MASKED WRITE sub-commands for
RECORD, MUTE and SOLO arming. It is important to note that this late
SOLO sub-command is just some MMC implementation mockup of mine, as I
believe there's no support whatsoever for just that from the official
MIDI MMC RP-013 document (which I don't even have access to date:)
However, I've been prototyping around with this, to my own amusement and
home-brew audio/MIDI sequencer, qtractor:
	http://qtractor.sourceforge.net

- NULL fader switch LED is now switchable on/off, but not actually of
any usefulness at this time ;)

I have tried to maintain all previous functionality as it were. Of
course I only tested this new stuff over my own US-224, for which it
surely needs the '-m us224' command-line option. This is also proposedto
be specified in a correspondent udev rule, for all this to work
correctly OOTB for the US-224 at least. US-428 owners don't need to
bother ;)

From: Rui Nuno Capela <rncbc@rncbc.org>
This commit is contained in:
Takashi Iwai 2007-02-15 00:22:20 +01:00
parent ca6a8bac3c
commit 711d2aec15
6 changed files with 383 additions and 74 deletions

View file

@ -3,6 +3,7 @@
* Controller for Tascam US-X2Y
*
* Copyright (c) 2003 by Karsten Wiese <annabellesgarden@yahoo.de>
* Copyright (c) 2004-2007 by Rui Nuno Capela <rncbc@rncbc.org>
*
* 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
@ -24,29 +25,50 @@
#include "Cus428_ctls.h"
class Cus428State: public us428_lights{
class Cus428State: public us428_lights
{
public:
Cus428State(struct us428ctls_sharedmem* Pus428ctls_sharedmem)
:us428ctls_sharedmem(Pus428ctls_sharedmem)
,MuteInputMonitor(0)
,Mute(0)
,SelectInputMonitor(0)
,Select(0)
// Constructor.
Cus428State(struct us428ctls_sharedmem* Pus428ctls_sharedmem, int y = 8)
:us428ctls_sharedmem(Pus428ctls_sharedmem),Y(y)
,us428_ctls(0)
,MuteInputMonitor(0)
,SoloInputMonitor(0)
,RecInputMonitor(0)
,SelectInputMonitor(0)
,aBank(0)
,cBanks(32 / y)
,W0(0)
,aWheel(0)
,aWheel_L(0)
,aWheel_R(0)
,bSetLocate(false)
,bSetRecord(false)
,uTransport(0)
,aWheelSpeed(0)
{
Mute = new unsigned char [cBanks];
Solo = new unsigned char [cBanks];
Rec = new unsigned char [cBanks];
Select = new unsigned char [cBanks];
for (int i = 0; i < cBanks; ++i)
Mute[i] = Solo[i] = Rec[i] = Select[i] = 0;
init_us428_lights();
for (int v = 0; v < 5; ++v) {
Volume[v].init(v);
}
}
enum eKnobs{
// Destructor.
virtual ~Cus428State() {
delete Select;
delete Rec;
delete Solo;
delete Mute;
}
enum eKnobs {
eK_RECORD = 72,
eK_PLAY,
eK_STOP,
@ -84,6 +106,7 @@ public:
eK_F2,
eK_F3,
};
void InitDevice(void);
void KnobChangedTo(eKnobs K, bool V);
@ -108,9 +131,13 @@ public:
void TransportToggle(unsigned char T);
void TransportSet(unsigned char T, bool V);
void TransportSend();
// Process masked-write sub-command.
void MaskedWrite(unsigned char *data);
// Reset internal MMC state.
void MmcReset();
protected:
void SendVolume(usX2Y_volume &V);
struct us428ctls_sharedmem* us428ctls_sharedmem;
bool StateInputMonitor() {
@ -124,13 +151,19 @@ protected:
void WheelShuttle(int dW);
// Get the curent wheel timecode.
void LocateTimecode(unsigned char *tc);
// Send own MMC masked-write subcommand.
void SendMaskedWrite(unsigned char scmd, int track, bool V);
usX2Y_volume_t Volume[5];
char MuteInputMonitor,
Mute,
SelectInputMonitor,
Select;
Cus428_ctls *us428_ctls;
// To hold channel light-mode states.
unsigned char
MuteInputMonitor, *Mute,
SoloInputMonitor, *Solo,
RecInputMonitor, *Rec,
SelectInputMonitor, *Select;
// The current selected bank, maximum number of bank/layers.
int aBank, cBanks;
// Differential wheel tracking.
int W0;
// Some way to convert wheel (absolute) position into hh:mm:ss:ff:fr
@ -140,16 +173,20 @@ protected:
int aWheel_R;
// SET knob state.
bool bSetLocate;
// REC knob state.
bool bSetRecord;
// Last/current transport state.
unsigned char uTransport;
// Shuttle wheel absolute speed.
int aWheelSpeed;
// The official number of faders (channels per bank)
int Y;
};
class Cus428StateMixxx: public Cus428State{
public:
Cus428StateMixxx(struct us428ctls_sharedmem* Pus428ctls_sharedmem);
Cus428StateMixxx(struct us428ctls_sharedmem* Pus428ctls_sharedmem, int y);
void UserKnobChangedTo(eKnobs K, bool V);
void UserSliderChangedTo(int S, unsigned char New);
void UserWheelChangedTo(E_In84 W, char Diff);