Skip to content

Commit

Permalink
Issues #133 and #134 fixes in progress, GUI tweaks.
Browse files Browse the repository at this point in the history
  • Loading branch information
ahlstromcj committed Dec 11, 2024
1 parent 005d5e1 commit 9b2c84e
Show file tree
Hide file tree
Showing 19 changed files with 350 additions and 214 deletions.
28 changes: 20 additions & 8 deletions NEWS
Original file line number Diff line number Diff line change
@@ -1,29 +1,41 @@
NEWS for Seq66 0.99.17
Chris Ahlstrom
2015-07-10 to 2024-12-04
2015-07-10 to 2024-12-11

# Change Log

## [0.99.17]
## [0.99.17] - 2024-12-11

This release is in progress....

### Added

### Changed

- Revamped and extended the functionality of the Pattern-Fix dialog.
As part of this, the alteration API of the event-list has been
updated.

### Fixed

- Issue #128 follow-on. Fixed the removal of trailing notes after
truncating a pattern to a smaller number of measures.
- Issue #133.
- Pattern editor. Changed the slot connection for editable
combo-boxes to connect the lineEdit() accessor.
- Measures (pattern length) combo-box.

- Issue #134.Added dates to the release-name line from 0.99.14 on;
were left off by an oversight.
- Cleaned up and upgraded the linking of recorded notes.
- Made ghost notes in selection box official. Also made it apply
to select-all and other selection operations.
- Fixed the removal of trailing notes after truncating a pattern
to a smaller number of measures. Kind of a follow-on to
issue #128.
- Fixing and normalizing the functionality of the Pattern-Fix dialog.
- Some minor tweaking (field size, font) of various dialogs.

### Removed

## [0.99.16]
## [0.99.16] - 2024-12-03

This release provides fixes to user issues and a ton of related
fixes found while investigating the user issues. Some minor new
Expand Down Expand Up @@ -113,7 +125,7 @@ features added.
then more lines are thinner or dotted; useful if the foreground
color is bright. It mainly affects the song editor.

## [0.99.15]
## [0.99.15] - 2024-10-28

### Added

Expand All @@ -135,7 +147,7 @@ features added.
- Progress made getting a build to work in MSYS2. Not yet ready.
- Built on Windows 11 with a update to Qt 5.15.2 and mingw 8.10.

## [0.99.14]
## [0.99.14] - 2024-08-14

### Added

Expand Down
12 changes: 6 additions & 6 deletions TODO
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,7 @@ ISSUES:

In the pattern edit window, the reset pattern to 1 button no longer works
properly. It either shrinks to some bar other than 1 or just does nothing
at all.
at all. PARTLY FIXED. Does not prompt for truncating notes.

There is also a behaviour when you manually select or type the number of
bars and it is smaller than the amount of already existing bars with notes
Expand All @@ -381,11 +381,11 @@ ISSUES:
These have appeared since https://github.com/ahlstromcj/seq66/issues/128 so
possibly connected.

A third issue which occurred before was with manually editing the amount
of bars with double digits. The bars refresh for each digit entered. For
example So if you have 16 bars and you want to shrink to 14 bars, it will
first shrink it to 1 bar as you type over. If the bars are full then the
dialog will pop up about losing notes. If you then click ok, instead of
FIXED: A third issue which occurred before was with manually editing the
amount of bars with double digits. The bars refresh for each digit entered.
For example So if you have 16 bars and you want to shrink to 14 bars, it
will first shrink it to 1 bar as you type over. If the bars are full then
the dialog will pop up about losing notes. If you then click ok, instead of
cancel, you will lose anything in the latter 15 bars.

To close as pushed off to version 2:
Expand Down
18 changes: 14 additions & 4 deletions libseq66/include/midi/calculations.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
* \library seq66 application
* \author Chris Ahlstrom
* \date 2015-11-07
* \updates 2024-12-07
* \updates 2024-12-10
* \license GNU GPLv2 or above
*
* These items were moved from the globals.h module so that only the modules
Expand Down Expand Up @@ -520,12 +520,20 @@ pulses_per_beat (int ppq, int beatspm = 4, int beatwidth = 4)
* beat_width beats. So:
*
\verbatim
p = 4 * P * m * B / W
p = 4 * P * M * B / W
p == pulse count (ticks or pulses)
m == number of measures
M == number of measures
B == beats per measure (constant)
P == pulses per quarter-note (constant)
W == beat width in beats per measure (constant)
\endverbatim
*
* Testing the units:
*
\verbatim
4 qn pulses beats
p pulses = --- ---- x P ------ x B ----- x M bars
W beat qn bar
\endverbatim
*
* For our "b4uacuse" MIDI file, M can be about 100 measures, B is 4,
Expand All @@ -544,7 +552,9 @@ pulses_per_beat (int ppq, int beatspm = 4, int beatwidth = 4)
* \param bw
* The W value in the equation, the denominator of the time signature.
* If this value is 0, we'll get an arithmetic exception (crash), so we
* just return 0 in this case.
* just return 0 in this case. The quantity 4 / W is in units of
* quarter-notes/beat. So a beat-width of 8 is 1/2 qn/beat, or
* an eighth note.
*
* \param measures
* The M value in the equation. It defaults to 1, in case one desires a
Expand Down
16 changes: 12 additions & 4 deletions libseq66/include/midi/eventlist.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
* \library seq66 application
* \author Chris Ahlstrom
* \date 2015-09-19
* \updates 2024-12-08
* \updates 2024-12-09
* \license GNU GPLv2 or above
*
* This module extracts the event-list functionality from the sequencer
Expand Down Expand Up @@ -76,11 +76,17 @@

#undef SEQ66_LINK_NEWEST_NOTE_ON_RECORD

/**
* The jitter_events() function is currently unused, so it is macroed out.
*/

#undef SEQ66_USE_JITTER_EVENTS

/**
* This flag is used in eventlist and sequence to supposedly protect sorting
* and clearing. However, we were able to delete events, clear all events,
* and even delete patterns while playback was occuring. So we don't think we
* need this. Define it if problems crop up. EXPERIMENTAL.
* need this after all. Define it if problems crop up. EXPERIMENTAL.
*/

#undef SEQ66_USE_ACTION_IN_PROGRESS_FLAG
Expand Down Expand Up @@ -426,7 +432,7 @@ class eventlist
midibyte status, midibyte cc,
int snap, int divide
);
bool quantize_all_events (int snap, int divide = 1);
bool quantize_events (int snap, int divide = 1, bool all = false);
bool quantize_notes (int snap, int divide = 1, bool all = false);
midipulse adjust_timestamp (event & er, midipulse deltatick);
void scale_note_off (event & noteoff, double factor);
Expand All @@ -442,7 +448,9 @@ class eventlist
bool align_left (bool relink = false);
bool randomize (midibyte status, int plus_minus, bool all = false);
bool randomize_notes (int range, bool all = false);
bool jitter_all_events (int snap, int jitr);
#if defined SEQ66_USE_JITTER_EVENTS
bool jitter_events (int snap, int jitr);
#endif
bool jitter_notes (int snap, int jitr, bool all = false);
void link_new (bool wrap = false);
bool link_notes (event::iterator eon, event::iterator eoff);
Expand Down
16 changes: 8 additions & 8 deletions libseq66/include/play/performer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2303,6 +2303,14 @@ class performer
void set_left_tick (midipulse tick);
void set_left_tick_seq (midipulse tick, midipulse snap);

void set_right_tick (midipulse tick);
void set_right_tick_seq (midipulse tick, midipulse snap);

midipulse get_right_tick () const
{
return m_right_tick;
}

/**
* For every pattern/sequence that is active, sets the "original tick"
* value for the pattern. This is really the "last tick" value, so we
Expand Down Expand Up @@ -2333,14 +2341,6 @@ class performer
return m_start_tick;
}

void set_right_tick (midipulse tick);
void set_right_tick_seq (midipulse tick, midipulse snap);

midipulse get_right_tick () const
{
return m_right_tick;
}

/**
* Convenience function for JACK support when loop in song mode.
*
Expand Down
3 changes: 2 additions & 1 deletion libseq66/include/play/sequence.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
* \library seq66 application
* \author Chris Ahlstrom
* \date 2015-07-30
* \updates 2024-12-08
* \updates 2024-12-09
* \license GNU GPLv2 or above
*
* The functions add_list_var() and add_long_list() have been replaced by
Expand Down Expand Up @@ -154,6 +154,7 @@ struct fixparameters
int & fp_beat_width;
double & fp_measures;
double & fp_scale_factor;
std::string fp_notemap_file;
fixeffect & fp_effect;
};

Expand Down
38 changes: 31 additions & 7 deletions libseq66/src/midi/eventlist.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
* \library seq66 application
* \author Chris Ahlstrom
* \date 2015-09-19
* \updates 2024-12-08
* \updates 2024-12-09
* \license GNU GPLv2 or above
*
* This container now can indicate if certain Meta events (time-signaure or
Expand Down Expand Up @@ -889,7 +889,7 @@ eventlist::quantize_events
}

/**
* Quantizes all events, unconditionally. No adjustment for wrapped notes
* Quantizes events, unconditionally. No adjustment for wrapped notes
* is made.
*
* \param snap
Expand All @@ -901,18 +901,35 @@ eventlist::quantize_events
* An indicator of the amount of quantization. The values are either
* 1 ("quantize") or 2 ("tighten"). The default value is 1, which makes
* the snap parameter the quantization value.
*
* \param all
* If true (the default is false), then all events, not just selected
* ones, are quantized.
*
* \return
* Returns true if events were quantized.
*/

bool
eventlist::quantize_all_events (int snap, int divide)
eventlist::quantize_events (int snap, int divide, bool all)
{
bool result = false;
midipulse len = get_length();
bool tight = divide == 2;
bool found_note = false;
midipulse len = get_length();
for (auto & er : m_events)
result = tight ? er.tighten(snap, len) : er.quantize(snap, len) ;
{
if (all || er.is_selected())
{
bool ok = tight ? er.tighten(snap, len) : er.quantize(snap, len) ;
if (ok)
result = true;

if (result)
if (er.is_note())
found_note = true;
}
}
if (result && found_note)
verify_and_link(); /* sorts them again!!! */

return result;
Expand All @@ -931,6 +948,9 @@ eventlist::quantize_all_events (int snap, int divide)
* \param all
* If false (the default), then only selected notes are acted on.
* Otherwise, they all are.
*
* \return
* Returns true if notes were quantized.
*/

bool
Expand Down Expand Up @@ -1384,6 +1404,8 @@ eventlist::randomize_notes (int range, bool all)
return result;
}

#if defined SEQ66_USE_JITTER_EVENTS

/**
* This function jitters the timestamps of all events. If note events were
* jittered, then we verify-and-link.
Expand All @@ -1403,7 +1425,7 @@ eventlist::randomize_notes (int range, bool all)
*/

bool
eventlist::jitter_all_events (int snap, int jitr)
eventlist::jitter_events (int snap, int jitr)
{
bool result = false;
if (jitr > 0)
Expand Down Expand Up @@ -1455,6 +1477,8 @@ eventlist::jitter_all_events (int snap, int jitr)
return result;
}

#endif // defined SEQ66_USE_JITTER_EVENTS

/**
* This function jitters the timestamps of all note events. If any
* were jittered, then we verify-and-link.
Expand Down
18 changes: 16 additions & 2 deletions libseq66/src/play/performer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2299,6 +2299,19 @@ performer::finish_move (seq::number seqno)
return result;
}

/**
* Do a fix-pattern operation on a sequence.
*
* Issue:
*
* Using notify_trigger_change(), the pattern editor is redrawn
* only when focus moves from the qpatternfix to qseqeditframe64.
*
* With the following notification, no updates at all occur!
*
* notify_sequence_change(seqno, change::yes);
*/

bool
performer::fix_pattern (seq::number seqno, fixparameters & params)
{
Expand All @@ -2308,7 +2321,7 @@ performer::fix_pattern (seq::number seqno, fixparameters & params)
{
result = s->fix_pattern(params);
if (result)
notify_trigger_change(seqno);
notify_trigger_change(seqno, change::yes);
}
return result;
}
Expand Down Expand Up @@ -6226,7 +6239,8 @@ performer::delete_trigger (seq::number seqno, midipulse tick)
bool
performer::transpose_trigger
(
seq::number seqno, midipulse tick, int transposition)
seq::number seqno, midipulse tick, int transposition
)
{
bool result = false;
if (transposition != 0)
Expand Down
Loading

0 comments on commit 9b2c84e

Please sign in to comment.