Digigurdy-baz
Loading...
Searching...
No Matches
Public Member Functions | List of all members
GurdyString Class Reference

#include <gurdystring.h>

Public Member Functions

 GurdyString (int my_channel, int my_note, String my_name, int my_mode, int my_vol=70)
 Constructor. GurdyString manages turning "strings" on and off, determining its note, and interacting with the MIDI layer. More...
 
void soundOn (int my_offset=0, int my_modulation=0)
 Turns on sound over this string's MIDI channel at its current volume. More...
 
void soundOn (int my_offset, int my_modulation, int note)
 Turns on a specific note over this string's MIDI channel at its current volume. More...
 
void soundOff ()
 Turns off the sound currently playing for this string, nicely. More...
 
void soundOff (int note)
 Turns off sound to a specific note. More...
 
void soundKill ()
 Issues a MIDI CC123 to the string's MIDI channel, killing all sound on it. More...
 
int getOpenNote ()
 Returns the string's open (base) note. More...
 
void setOpenNote (int new_note)
 Sets a new base note for this string. More...
 
void setVolume (int vol)
 Sets a new volume for this string. More...
 
int getVolume ()
 Returns the string's MIDI volume. More...
 
void setMute (bool mute)
 Mutes/unmutes the string. More...
 
bool getMute ()
 Returns the string's mute/unmute status. More...
 
bool isPlaying ()
 Reports if the string is currently playing a note. More...
 
void setProgram (uint8_t program)
 Send a MIDI Program Change to this string's MIDI channel. More...
 
void setExpression (int exp)
 Sends a MIDI CC11 (Expression) value to this string's MIDI channel. More...
 
void setPitchBend (int bend)
 Bends this string's sound to the specified amount. More...
 
void setVibrato (int vib)
 Sets the amount of modulation (vibrato) on this string. More...
 
String getName ()
 Returns the text name of this string. More...
 
void setOutputMode (int my_mode)
 Sets the secondary output mode for this string. More...
 
void setGrosMode (int my_gros_mode)
 Sets the "gros-mode" for this string. More...
 
int getGrosMode ()
 
String getGrosString ()
 
void setTrackLoops ()
 Sets the Trigger/Tsunami loop mode on all of the tracks this string may use. More...
 
void clearVolArray ()
 

Constructor & Destructor Documentation

◆ GurdyString()

GurdyString::GurdyString ( int  my_channel,
int  my_note,
String  my_name,
int  my_mode,
int  my_vol = 70 
)

Constructor. GurdyString manages turning "strings" on and off, determining its note, and interacting with the MIDI layer.

Parameters
my_channelThe MIDI channel to communicate over
my_noteThe base MIDI note of this string (0-127)
my_nameA text label for this string (e.g. "Drone")
my_modeThe secondary output mode (see setOutputMode() for more info)
my_volThe volume of this string (0-127)

Member Function Documentation

◆ clearVolArray()

void GurdyString::clearVolArray ( )

◆ getGrosMode()

int GurdyString::getGrosMode ( )

◆ getGrosString()

String GurdyString::getGrosString ( )

◆ getMute()

bool GurdyString::getMute ( )

Returns the string's mute/unmute status.

Returns
True if muted, false if unmuted

◆ getName()

String GurdyString::getName ( )

Returns the text name of this string.

Returns
The string's display name

◆ getOpenNote()

int GurdyString::getOpenNote ( )

Returns the string's open (base) note.

Returns
The string's base note as a MIDI note number 0-127

◆ getVolume()

int GurdyString::getVolume ( )

Returns the string's MIDI volume.

Returns
The string's volume, 0-127

◆ isPlaying()

bool GurdyString::isPlaying ( )

Reports if the string is currently playing a note.

Returns
True if playing a note, false otherwise.

◆ setExpression()

void GurdyString::setExpression ( int  exp)

Sends a MIDI CC11 (Expression) value to this string's MIDI channel.

Parameters
expThe expression value, 0-127.
Note
This has no effect on Tsunami/Trigger units.

◆ setGrosMode()

void GurdyString::setGrosMode ( int  my_gros_mode)

Sets the "gros-mode" for this string.

Value of this should be 0-3:

  • 0 = no additional sound
  • 1 = a perfect fourth below (-5 semitones)
  • 2 = a perfect fifth below (-7 semitones)
  • 3 = an octave below (-12 semitones)
    Parameters
    my_gros_mode

◆ setMute()

void GurdyString::setMute ( bool  mute)

Mutes/unmutes the string.

Parameters
muteTrue = mute, false = unmute
Note
While muted, soundOn/Off events do nothing. This exists for programming ease (calling sounOn() on all strings without checking if they are muted).

◆ setOpenNote()

void GurdyString::setOpenNote ( int  new_note)

Sets a new base note for this string.

Parameters
new_noteThe new base MIDI note (0-127) for this string

◆ setOutputMode()

void GurdyString::setOutputMode ( int  my_mode)

Sets the secondary output mode for this string.

Parameters
my_mode0-2

Modes accepted:

  • 0 - MIDI-OUT socket
  • 1 - A Trigger/Tsunami device
  • 2 - Both

◆ setPitchBend()

void GurdyString::setPitchBend ( int  bend)

Bends this string's sound to the specified amount.

Parameters
bendThe amount of pitch bend. 0 to 16383, where 8192 = no bend.
Note
This has no effect on Tsunami/Trigger units.

◆ setProgram()

void GurdyString::setProgram ( uint8_t  program)

Send a MIDI Program Change to this string's MIDI channel.

Parameters
programThe program change value, 0-127.
Note
This has no effect on Tsunami/Trigger units.

◆ setTrackLoops()

void GurdyString::setTrackLoops ( )

Sets the Trigger/Tsunami loop mode on all of the tracks this string may use.

◆ setVibrato()

void GurdyString::setVibrato ( int  vib)

Sets the amount of modulation (vibrato) on this string.

Parameters
vibThe amount of modulation, 0-127.
Note
This is MIDI CC1, the "mod wheel". Intended to used for a vibrato effect.

◆ setVolume()

void GurdyString::setVolume ( int  vol)

Sets a new volume for this string.

Parameters
volThe new MIDI volume for this string. 0 = silent, 127 = full volume.
Note
On Tsunami/Trigger units, this is translated to the -70 to +10 scale used on those internally.
  • MIDI volume 112 = line-out volume level on Tsunami/Trigger units.

◆ soundKill()

void GurdyString::soundKill ( )

Issues a MIDI CC123 to the string's MIDI channel, killing all sound on it.

Note
On Tsunami/Trigger units, this kills all tracks playing. This is not meant be the regular way to turn off sound, see soundOff() which does it more gently.

◆ soundOff() [1/2]

void GurdyString::soundOff ( )

Turns off the sound currently playing for this string, nicely.

◆ soundOff() [2/2]

void GurdyString::soundOff ( int  note)

Turns off sound to a specific note.

Parameters
noteThe specific note to stop

◆ soundOn() [1/2]

void GurdyString::soundOn ( int  my_offset,
int  my_modulation,
int  note 
)

Turns on a specific note over this string's MIDI channel at its current volume.

This is meant to be for the second drone option, and bypasses the note_being_played logic.

Parameters
my_offsetThe offset from the string's base note to make sound. Unused here.
my_modulationThe amount of optional modulation (0-127) to apply to the sound. This is MIDI CC1. 0 == no modulation. Unused here.
noteThe specific note to sound.
Warning
my_modulation and my_offset only exist in this incarnation of the method because it keeps it from being ambiguous compared the other one. Maybe I should change this.

◆ soundOn() [2/2]

void GurdyString::soundOn ( int  my_offset = 0,
int  my_modulation = 0 
)

Turns on sound over this string's MIDI channel at its current volume.

Parameters
my_offsetThe offset from the string's base note to make sound
my_modulationThe amount of optional modulation (0-127) to apply to the sound. This is MIDI CC1. 0 == no modulation.
Warning
The way this is currently written, only one note may be playing per string object. Don't call this twice in a row without calling soundOff() first.

The documentation for this class was generated from the following files: