File tree Expand file tree Collapse file tree 3 files changed +23
-0
lines changed Expand file tree Collapse file tree 3 files changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -89,6 +89,10 @@ Tsunami tsunami;
89
89
audio is playing, you will hear the result immediately. If audio is not playing,
90
90
the new gain will be used the next time a track is started.
91
91
92
+ ** tsunami.inputGain(int gain)** - this function immediately sets the gain of the
93
+ stereo input to the specified value. The range for gain is -70 to +4. If audio
94
+ audio is playing, you will hear the result immediately.
95
+
92
96
** tsunami.samplerateOffset(int out, int offset)** - this function immediately sets sample-rate offset,
93
97
or playback speed / pitch, of the specified stereo output. The range for
94
98
for the offset is -32767 to +32676, giving a speed range of 1/2x to 2x, or a
Original file line number Diff line number Diff line change @@ -193,6 +193,23 @@ uint8_t o;
193
193
TsunamiSerial.write (txbuf, 8 );
194
194
}
195
195
196
+ // **************************************************************
197
+ void Tsunami::inputGain (int gain) {
198
+
199
+ uint8_t txbuf[8 ];
200
+ unsigned short vol;
201
+
202
+ txbuf[0 ] = SOM1;
203
+ txbuf[1 ] = SOM2;
204
+ txbuf[2 ] = 0x07 ;
205
+ txbuf[3 ] = CMD_MASTER_VOLUME;
206
+ vol = (unsigned short )gain;
207
+ txbuf[4 ] = (uint8_t )vol;
208
+ txbuf[5 ] = (uint8_t )(vol >> 8 );
209
+ txbuf[6 ] = EOM;
210
+ TsunamiSerial.write (txbuf, 7 );
211
+ }
212
+
196
213
// **************************************************************
197
214
void Tsunami::setReporting (bool enable) {
198
215
Original file line number Diff line number Diff line change 36
36
#define CMD_SET_TRIGGER_BANK 14
37
37
#define CMD_SET_INPUT_MIX 15
38
38
#define CMD_SET_MIDI_BANK 16
39
+ #define CMD_INPUT_GAIN 18
39
40
40
41
#define TRK_PLAY_SOLO 0
41
42
#define TRK_PLAY_POLY 1
@@ -99,6 +100,7 @@ class Tsunami
99
100
int getNumTracks (void );
100
101
bool isTrackPlaying (int trk);
101
102
void masterGain (int out, int gain);
103
+ void inputGain (int gain);
102
104
void stopAllTracks (void );
103
105
void resumeAllInSync (void );
104
106
void trackPlaySolo (int trk, int out, bool lock);
You can’t perform that action at this time.
0 commit comments