-
Notifications
You must be signed in to change notification settings - Fork 172
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Variable resolution support #1173
base: development
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -60,12 +60,16 @@ class Song : public H2Core::Object | |
SONG_MODE | ||
}; | ||
|
||
static constexpr int nDefaultResolutionTPQN = 48; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. From my recent experience on H2 code, it seems better to have this expressed in Ticks per whole notes, because the grid resolutions, i.e. the inverses of quantum note values (1/4, 1/8, 1/16...) refer to that unit... There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Only because that's what MIDI uses, and that's what the core already uses (because it looks like it was heavily influenced by MIDI). Multiplying up by 4 when needed (seems to be a fairly small number of uses) is a fairly small price to pay for the consistency (if not, a macro can be defined). There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ok. |
||
|
||
Song( const QString& sName, const QString& sAuthor, float fBpm, float fVolume ); | ||
~Song(); | ||
|
||
static Song* getEmptySong(); | ||
static Song* getDefaultSong(); | ||
|
||
int getDefaultPatternSize() const; | ||
|
||
bool getIsMuted() const; | ||
void setIsMuted( bool bIsMuted ); | ||
|
||
|
@@ -285,6 +289,11 @@ class Song : public H2Core::Object | |
|
||
}; | ||
|
||
inline int Song::getDefaultPatternSize() const | ||
{ | ||
return getResolution() * 4; | ||
} | ||
|
||
inline bool Song::getIsMuted() const | ||
{ | ||
return m_bIsMuted; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you explain this please?
If
m_nResolution = 3
(3 ticks per quarter notes or whole notes?), and the pattern has a note at position = 7,the ratio
m_nResolution / nDenominator
equals (int) 3/7 = 0, right?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, there's a bug here. nDenominator should be initialised to 1, not 0.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why 1? then at the end of the loop
nDenominator
will be always 1