Deluge Firmware
1.3.0
Build date: 2026.08.29
Toggle main menu visibility
Loading...
Searching...
No Matches
non_audio_drum.h
1
/*
2
* Copyright © 2018-2023 Synthstrom Audible Limited
3
*
4
* This file is part of The Synthstrom Audible Deluge Firmware.
5
*
6
* The Synthstrom Audible Deluge Firmware is free software: you can redistribute it and/or modify it under the
7
* terms of the GNU General Public License as published by the Free Software Foundation,
8
* either version 3 of the License, or (at your option) any later version.
9
*
10
* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
11
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
12
* See the GNU General Public License for more details.
13
*
14
* You should have received a copy of the GNU General Public License along with this program.
15
* If not, see <https://www.gnu.org/licenses/>.
16
*/
17
18
#pragma once
19
20
#include "definitions_cxx.hpp"
21
#include "model/drum/drum.h"
22
#include "model/mod_controllable/mod_controllable.h"
23
#include "modulation/arpeggiator.h"
24
#include <cstdint>
25
26
class
NonAudioDrum :
public
Drum,
public
ModControllable {
27
bool
state_ =
false
;
28
29
public
:
30
NonAudioDrum(DrumType newType) : Drum(newType) {}
31
32
// Voiced overrides
33
bool
anyNoteIsOn()
final
{
return
state_; };
34
[[nodiscard]]
bool
hasActiveVoices()
const
final
{
return
state_; };
35
void
killAllVoices()
override
;
36
bool
allowNoteTails(
ModelStackWithSoundFlags
* modelStack,
bool
disregardSampleLoop =
false
)
final
{
return
true
; }
37
38
bool
readDrumTagFromFile(
Deserializer
& reader,
char
const
* tagName);
39
40
virtual
int32_t getNumChannels() = 0;
41
42
virtual
int8_t modEncoderAction(
ModelStackWithThreeMainThings
* modelStack, int8_t offset, uint8_t whichModEncoder);
43
44
ModControllable* toModControllable()
override
{
return
this
; }
45
46
uint8_t lastVelocity;
47
48
uint8_t channel;
49
int8_t channelEncoderCurrentOffset = 0;
50
51
ArpeggiatorBase
* getArp() {
return
&arpeggiator; }
52
ArpeggiatorSettings
* getArpSettings(
InstrumentClip
* clip = NULL) {
return
&arpSettings; }
53
54
virtual
void
noteOnPostArp(int32_t noteCodePostArp,
ArpNote
* arpNote, int32_t noteIndex) { state_ =
true
; };
55
virtual
void
noteOffPostArp(int32_t noteCodePostArp) { state_ =
false
; };
56
57
void
writeArpeggiatorToFile(
Serializer
& writer);
58
59
protected
:
60
void
modChange(
ModelStackWithThreeMainThings
* modelStack, int32_t offset, int8_t* encoderOffset, uint8_t* value,
61
int32_t numValues);
62
};
ArpeggiatorBase
Definition
arpeggiator.h:220
ArpeggiatorSettings
Definition
arpeggiator.h:48
Deserializer
Definition
storage_manager.h:185
InstrumentClip
Definition
instrument_clip.h:48
ModelStackWithSoundFlags
Definition
model_stack.h:287
ModelStackWithThreeMainThings
Definition
model_stack.h:231
Serializer
Definition
storage_manager.h:119
ArpNote
Definition
arpeggiator.h:155