libpromeki main
PROfessional MEdia toolKIt
 
Loading...
Searching...
No Matches
musicalnote.h
Go to the documentation of this file.
1
8#pragma once
9
10#include <promeki/core/list.h>
11
13
32 public:
34
36 MusicalNote() = default;
37
39 float midiNote() const { return _midiNote; }
41 void setMidiNote(float v) { _midiNote = v; }
42
44 double startTime() const { return _startTime; }
46 void setStartTime(double v) { _startTime = v; }
47
49 double duration() const { return _duration; }
51 void setDuration(double v) { _duration = v; }
52
54 double fullDuration() const { return _fullDuration; }
56 void setFullDuration(double v) { _fullDuration = v; }
57
59 float amplitude() const { return _amplitude; }
61 void setAmplitude(float v) { _amplitude = v; }
62
64 float legato() const { return _legato; }
66 void setLegato(float v) { _legato = v; }
67
69 float vibrato() const { return _vibrato; }
71 void setVibrato(float v) { _vibrato = v; }
72
74 float vibratoRate() const { return _vibratoRate; }
76 void setVibratoRate(float v) { _vibratoRate = v; }
77
79 float tremolo() const { return _tremolo; }
81 void setTremolo(float v) { _tremolo = v; }
82
84 float tremoloRate() const { return _tremoloRate; }
86 void setTremoloRate(float v) { _tremoloRate = v; }
87
89 bool isRest() const { return _rest; }
91 void setRest(bool v) { _rest = v; }
92
93 private:
94 float _midiNote = -1.0f;
95 double _startTime = 0.0;
96 double _duration = 0.0;
97 double _fullDuration = 0.0;
98 float _amplitude = 0.5f;
99 float _legato = 0.5f;
100 float _vibrato = 0.0f;
101 float _vibratoRate = 5.0f;
102 float _tremolo = 0.0f;
103 float _tremoloRate = 5.0f;
104 bool _rest = false;
105};
106
Dynamic array container wrapping std::vector.
Definition list.h:40
List()=default
Default constructor. Creates an empty list.
Represents a single musical note with timing and expression data.
Definition musicalnote.h:31
MusicalNote()=default
Default-constructs an invalid (rest) note.
float tremoloRate() const
Tremolo rate in Hz.
Definition musicalnote.h:84
void setAmplitude(float v)
Sets the note amplitude.
Definition musicalnote.h:61
float vibrato() const
Vibrato depth in semitones.
Definition musicalnote.h:69
void setRest(bool v)
Sets whether this note is a rest.
Definition musicalnote.h:91
void setMidiNote(float v)
Sets the MIDI note number.
Definition musicalnote.h:41
void setTremolo(float v)
Sets the tremolo depth.
Definition musicalnote.h:81
float vibratoRate() const
Vibrato rate in Hz.
Definition musicalnote.h:74
void setVibrato(float v)
Sets the vibrato depth in semitones.
Definition musicalnote.h:71
void setStartTime(double v)
Sets the start time of the note in seconds.
Definition musicalnote.h:46
double duration() const
Sounding duration in seconds (after legato scaling).
Definition musicalnote.h:49
float tremolo() const
Tremolo depth in the range 0.0 to 1.0.
Definition musicalnote.h:79
void setFullDuration(double v)
Sets the full rhythmic duration in seconds.
Definition musicalnote.h:56
void setVibratoRate(float v)
Sets the vibrato rate in Hz.
Definition musicalnote.h:76
float amplitude() const
Note amplitude in the range 0.0 to 1.0.
Definition musicalnote.h:59
void setLegato(float v)
Sets the legato factor.
Definition musicalnote.h:66
double startTime() const
Start time of the note in seconds.
Definition musicalnote.h:44
float legato() const
Legato factor in the range 0.0 to 1.0.
Definition musicalnote.h:64
void setTremoloRate(float v)
Sets the tremolo rate in Hz.
Definition musicalnote.h:86
void setDuration(double v)
Sets the sounding duration in seconds.
Definition musicalnote.h:51
bool isRest() const
Returns true if this note is a rest (silence).
Definition musicalnote.h:89
double fullDuration() const
Full rhythmic duration in seconds (before legato scaling).
Definition musicalnote.h:54
float midiNote() const
MIDI note number (fractional). Negative values indicate a rest.
Definition musicalnote.h:39
#define PROMEKI_NAMESPACE_BEGIN
Starts a promeki namespace block.
Definition namespace.h:14
#define PROMEKI_NAMESPACE_END
Ends a promeki namespace block.
Definition namespace.h:19