Digigurdy-baz
Loading...
Searching...
No Matches
gurdystring.h
Go to the documentation of this file.
1#ifndef GURDYSTRING_H
2#define GURDYSTRING_H
3
4#include "config.h"
5#include "notes.h"
6
7// https://www.pjrc.com/teensy/td_midi.html
8// https://www.pjrc.com/teensy/td_libs_MIDI.html
9#include <MIDI.h>
10
11#ifdef USE_TRIGGER
12 #include "wavTrigger.h"
13 extern wavTrigger trigger_obj;
14#endif
15
16#ifdef USE_TSUNAMI
17 #include "Tsunami.h"
18 extern Tsunami trigger_obj;
19#endif
20
21extern MIDI_NAMESPACE::MidiInterface<MIDI_NAMESPACE::SerialMIDI<HardwareSerial>> MIDI;
22
23
25 private:
26 String name;
27 int open_note; // This string's base note
28 int midi_channel; // This string's MIDI channel (1-8)
29 int midi_volume; // 0-127, I'm using 56 everywhere right now
30 int trigger_volume; // For Tsunami/Trigger
31 bool mute_on = false; // Controls the mute feature
32 bool is_playing = false;
33 int note_being_played; // The note being sounded (base note + key offset)
34 // This is necessary to turn off notes before turning on new ones.
35 int output_mode;
36 int gros_mode;
37 int vol_array[128];
38
39 public:
40 GurdyString(int my_channel, int my_note, String my_name, int my_mode, int my_vol = 70);
41 void soundOn(int my_offset = 0, int my_modulation = 0);
42 void soundOn(int my_offset, int my_modulation, int note);
43 void soundOff();
44 void soundOff(int note);
45 void soundKill();
46 int getOpenNote();
47 void setOpenNote(int new_note);
48 void setVolume(int vol);
49 int getVolume();
50 void setMute(bool mute);
51 bool getMute();
52 bool isPlaying();
53 void setProgram(uint8_t program);
54 void setExpression(int exp);
55 void setPitchBend(int bend);
56 void setVibrato(int vib);
57 String getName();
58 void setOutputMode(int my_mode);
59 void setGrosMode(int my_gros_mode);
60 int getGrosMode();
61 String getGrosString();
62 void setTrackLoops();
63 void clearVolArray();
64};
65
66#endif
Definition: gurdystring.h:24
String getGrosString()
Definition: gurdystring.cpp:318
void setVibrato(int vib)
Sets the amount of modulation (vibrato) on this string.
Definition: gurdystring.cpp:279
bool isPlaying()
Reports if the string is currently playing a note.
Definition: gurdystring.cpp:237
void clearVolArray()
Definition: gurdystring.cpp:343
void setGrosMode(int my_gros_mode)
Sets the "gros-mode" for this string.
Definition: gurdystring.cpp:310
String getName()
Returns the text name of this string.
Definition: gurdystring.cpp:289
void setOpenNote(int new_note)
Sets a new base note for this string.
Definition: gurdystring.cpp:201
int getVolume()
Returns the string's MIDI volume.
Definition: gurdystring.cpp:218
bool getMute()
Returns the string's mute/unmute status.
Definition: gurdystring.cpp:231
void setExpression(int exp)
Sends a MIDI CC11 (Expression) value to this string's MIDI channel.
Definition: gurdystring.cpp:256
void soundOff()
Turns off the sound currently playing for this string, nicely.
Definition: gurdystring.cpp:128
void soundOn(int my_offset=0, int my_modulation=0)
Turns on sound over this string's MIDI channel at its current volume.
Definition: gurdystring.cpp:35
void setTrackLoops()
Sets the Trigger/Tsunami loop mode on all of the tracks this string may use.
Definition: gurdystring.cpp:334
void setProgram(uint8_t program)
Send a MIDI Program Change to this string's MIDI channel.
Definition: gurdystring.cpp:244
void setMute(bool mute)
Mutes/unmutes the string.
Definition: gurdystring.cpp:225
void setVolume(int vol)
Sets a new volume for this string.
Definition: gurdystring.cpp:211
int getOpenNote()
Returns the string's open (base) note.
Definition: gurdystring.cpp:195
int getGrosMode()
Definition: gurdystring.cpp:314
void setPitchBend(int bend)
Bends this string's sound to the specified amount.
Definition: gurdystring.cpp:268
void soundKill()
Issues a MIDI CC123 to the string's MIDI channel, killing all sound on it.
Definition: gurdystring.cpp:178
void setOutputMode(int my_mode)
Sets the secondary output mode for this string.
Definition: gurdystring.cpp:299
MIDI_NAMESPACE::MidiInterface< MIDI_NAMESPACE::SerialMIDI< HardwareSerial > > MIDI
wavTrigger trigger_obj
Definition: gurdystring.h:18