Skip to content

Commit

Permalink
Fixed BPM saving error in Windows, issue #110.
Browse files Browse the repository at this point in the history
  • Loading branch information
ahlstromcj committed Jul 6, 2023
1 parent 3b68bc2 commit 1bfe555
Show file tree
Hide file tree
Showing 7 changed files with 62 additions and 86 deletions.
12 changes: 8 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# README for Seq66 0.99.7 2023-07-04
# README for Seq66 0.99.7 2023-07-06

__Seq66__: MIDI sequencer/live-looper with a hardware-sampler grid interface;
pattern banks, triggers, and playlists for song management; scale and chord
Expand Down Expand Up @@ -82,10 +82,14 @@ Windows, and using a conventional source tarball.
## Recent Changes

* Version 0.99.7:
* Issue #111 follow-ons: Fixed initial time-signature drawing in
data pane.
* Issue #111 follow-ons:
* Fixed initial time-signature drawing in data pane.
* Fixed errors in inserting a time-signature. Added a pulse
calculator that iterates through time-signatures.
* Issue #110 follow-ons: Cannot save tempo (BPM) in Windows when
changed from main window.
changed from main window. This was caused by mixing a long
and a size_t and sizeof(long) in the Windows build.
* Recent Files is disabled if there are none.
* Version 0.99.6:
* Issue #3 follow-ons:
* Added a qscrollslave to allow QScrollArea to allow the pattern
Expand Down
49 changes: 8 additions & 41 deletions RELNOTES
Original file line number Diff line number Diff line change
@@ -1,47 +1,14 @@
Release Notes for Seq66 v. 0.99.6 2023-07-01
Release Notes for Seq66 v. 0.99.7 2023-07-05

This file lists __major__ changes from version 0.99.6
This file lists __major__ changes from version 0.99.7

- Issue #3 follow-ons:
- Pattern editor panes stay in sync with the piano roll using
the hjkl, arrow, and page keys. Scroll wheel works in
the piano roll.
- Issue #110 follow-ons:
- Addition of Start menu entries for Windows.
- Fixed access to the tutorial and manual.
- data/readme & doc/tutorial files fixed for NSIS installer.
- Fixed the saving of modified tempo changes.
- Fixed changing note velocities in the pattern editor data
pane. Improved velocity-change undo.
- Fixed error preventing changing the "background" pattern.
- Remaining issue: Building 32-bit (Windows XP) version on
64-bit Windows.
- Issue #111:
- Added support for editing, storing, and displaying time
signatures in the pattern and event editors.
- The first time-signature in a pattern becomes the main
time signature of the pattern.
- The data pane shows a time-signature as a simple fraction.
- Changing the time signature if at time 0 is automatic.
- Time signatures at later times are logged by setting the
current time with a click in the top half of the time line,
changing the beats and beat width, then clicking a
time-sig log button.
- Non-MIDI-standard beat-widths are supported as a
Seq66-specific "event".
- Fixed event filtering in the event (qstriggereditor) pane.
- As time-signatures change, Seq66 adjusts the piano roll,
time line (with measure counts), and event pane vertical
lines.
- Port-mapping prompts about port issues and allows an immediate
remap-and-restart.
- 'o' keystroke in seqroll toggles recording ('r' already
taken).
- Added a "quiet" option to not show startup message prompts.
- A log-file is now created by default & kept under a megabyte.
- Added the pattern port number to the Song Summary output.
- A large number of fixes of unrelated issues.
- Should BPM changes raise the modification flag with no
file in force?
- Issue #111 follow-ons:
- Fixed inserting/appending time signatures in the event
editor.

Read the NEWS, README.md, and TODO files. Working our assoff!
Read the NEWS, README.md, and TODO files.

// vim: sw=4 ts=4 wm=15 et ft=sh
17 changes: 9 additions & 8 deletions TODO
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
TO DO for Seq66 0.99.7 (Sequencer64 refactored for C++14 and Qt)
TO DO for Seq66 0.99.7
Chris Ahlstrom
2019-04-13 to 2023-07-02

Port-mapping:

- Consider allowing the addition of an alias to a port. This would
be useful for devices attached to "USB Midi MIDI 1". However,
think about MIDNAM.
2019-04-13 to 2023-07-06

UI:

Expand All @@ -25,6 +19,7 @@ UI:
- Add option to start JACK if --jack?
- Do we need an option to auto-store changes in the event editor?
Easy to forget to push that button.
- Look into connecting the save-playlist and save-mutes functions.

Some of these issues will be pushed off for the distant Seq66v2.

Expand Down Expand Up @@ -84,6 +79,12 @@ Ideas:

- Drag and drop MIDI files onto seq66 (see sequencer64 issue #137)

Port-mapping:

- Consider allowing the addition of an alias to a port. This would
be useful for devices attached to "USB Midi MIDI 1". However,
think about MIDNAM.

ISSUES:

#3 Open loop Pattern Editor window.
Expand Down
11 changes: 8 additions & 3 deletions libseq66/include/midi/midifile.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
* \library seq66 application
* \author Chris Ahlstrom
* \date 2015-07-24
* \updates 2023-04-27
* \updates 2023-07-06
* \license GNU GPLv2 or above
*
* The Seq24 MIDI file is a standard, Format 1 MIDI file, with some extra
Expand Down Expand Up @@ -368,9 +368,14 @@ class midifile
bool read_meta_data (sequence & s, event & e, midibyte metatype, size_t len);
void read_gap (size_t sz);

void skip (midilong sz) /* compare to read_gap() */
void skip (size_t sz) /* compare to read_gap() */
{
m_pos += sz; /* sz can be 0 or negative */
m_pos += sz; /* sz can be 0 or positive */
}

void back_up (size_t sz)
{
m_pos -= sz; /* sz can be 0 or positive */
}

void write_long (midilong value);
Expand Down
19 changes: 10 additions & 9 deletions libseq66/src/midi/midifile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
* \library seq66 application
* \author Chris Ahlstrom
* \date 2015-07-24
* \updates 2023-06-13
* \updates 2023-07-06
* \license GNU GPLv2 or above
*
* For a quick guide to the MIDI format, see, for example:
Expand Down Expand Up @@ -1706,9 +1706,10 @@ midifile::parse_seqspec_header (int file_size)
midibyte status = (result & 0x00FF0000) >> 16; /* 2-byte shift */
if (status == EVENT_MIDI_META) /* 0xFF meta marker */
{
skip(-2); /* back up to meta type */
back_up(2); /* back up to meta type */

midibyte type = read_byte(); /* get meta type */
if (type == EVENT_META_SEQSPEC) /* 0x7F event marker */
if (type == EVENT_META_SEQSPEC) /* 0x7F event marker */
{
(void) read_varinum(); /* prop section length */
result = read_long(); /* control tag */
Expand Down Expand Up @@ -1806,15 +1807,15 @@ midifile::parse_seqspec_track (performer & p, int file_size)
m_error_is_fatal = false;
result = set_error_dump
(
"No sequence number in SeqSpec track, extra data"
"No sequence number in SeqSpec, extra data"
);
}
else
result = set_error("Unexpected sequence number, SeqSpec track");
result = set_error("Unexpected sequence number in SeqSpec");
}
}
else
skip(-4); /* unread the "ID code" */
back_up(4); /* unread the "ID code" */

if (result)
result = prop_header_loop(p, file_size);
Expand Down Expand Up @@ -1907,7 +1908,7 @@ midifile::parse_c_midictrl (performer & /* p*/)
int ctrls = int(read_long());
if (ctrls > usr().max_sequence())
{
skip(-4);
back_up(4);
(void) set_error_dump
(
"Bad MIDI-control sequence count, fixing.\n"
Expand All @@ -1916,7 +1917,7 @@ midifile::parse_c_midictrl (performer & /* p*/)
);
ctrls = midilong(read_byte());
}
midibyte a[6];
midibyte a[8];
for (int i = 0; i < ctrls; ++i)
{
read_byte_array(a, 6);
Expand Down Expand Up @@ -2774,7 +2775,7 @@ midifile::write (performer & p, bool doseqspec)
{
result = write_seqspec_track(p);
if (! result)
m_error_message = "Could not write SeqSpec track.";
m_error_message = "Could not write SeqSpec.";
}
if (result)
{
Expand Down
13 changes: 5 additions & 8 deletions libseq66/src/play/sequence.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -856,6 +856,7 @@ sequence::time_signature_pulses (const std::string & s) const
if (count > 0)
{
double mtarget = double(mm.measures());
bool got_it = false;
for (int i = 0; i < count; ++i)
{
const timesig & t0 = get_time_signature(i);
Expand All @@ -866,16 +867,12 @@ sequence::time_signature_pulses (const std::string & s) const
const timesig & t1 = get_time_signature(i + 1);
m1 = t1.sig_start_measure;
if (mtarget >= m0 && mtarget < m1)
{
double mcount = double(mm.measures()) - m0;
double tpb = double(t0.sig_ticks_per_beat);
double bpb = double(t0.sig_beats_per_bar);
midipulse added = midipulse(tpb * bpb * mcount);
result = t0.sig_start_tick + added + mm.divisions();
break;
}
got_it = true;
}
else /* target measure is after last time-signature change. */
got_it = true;

if (got_it)
{
double mcount = double(mm.measures()) - m0; /* integral? */
double tpb = double(t0.sig_ticks_per_beat);
Expand Down
27 changes: 14 additions & 13 deletions seq_qt5/src/qsmainwnd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
* \library seq66 application
* \author Chris Ahlstrom
* \date 2018-01-01
* \updates 2023-06-17
* \updates 2023-07-06
* \license GNU GPLv2 or above
*
* The main window is known as the "Patterns window" or "Patterns panel". It
Expand Down Expand Up @@ -493,25 +493,17 @@ qsmainwnd::qsmainwnd
/*
* Edit Menu. First connect the preferences dialog to the main window's
* Edit / Preferences menu entry. Then connect all the new Edit menu
* entries. Update: rather than wire in show() directly, we wire in another
* slot to allow syncing the Preferences dialog with the current status.
* entries. We wire in a slot to allow syncing the Preferences dialog
* with the current status.
*/

if (not_nullptr(m_dialog_prefs))
{
#if USE_DIRECT_SHOW_CONNECT
connect
(
ui->actionPreferences, SIGNAL(triggered(bool)),
m_dialog_prefs, SLOT(show())
);
#else
connect
(
ui->actionPreferences, SIGNAL(triggered(bool)),
this, SLOT(slot_open_edit_prefs())
);
#endif
}
connect
(
Expand Down Expand Up @@ -2934,8 +2926,11 @@ qsmainwnd::update_recent_files_menu ()
m_recent_action_list.at(fj)->setVisible(false);

ui->menuFile->insertMenu(ui->actionSave, m_menu_recent);
m_menu_recent->setEnabled(true);
}
}
else
m_menu_recent->setEnabled(false);
}

void
Expand Down Expand Up @@ -2965,11 +2960,17 @@ qsmainwnd::create_action_menu ()
if (not_nullptr(m_menu_recent) && m_menu_recent->isWidgetType())
delete m_menu_recent;

int count = rc().recent_file_max();
m_menu_recent = new QMenu(tr("&Recent MIDI Files..."), this);
for (int i = 0; i < rc().recent_file_max(); ++i)
if (count > 0)
{
m_menu_recent->addAction(m_recent_action_list.at(i));
m_menu_recent->setEnabled(true);
for (int i = 0; i < rc().recent_file_max(); ++i)
m_menu_recent->addAction(m_recent_action_list.at(i));
}
else
m_menu_recent->setEnabled(false);

ui->menuFile->insertMenu(ui->actionSave, m_menu_recent);
}

Expand Down

0 comments on commit 1bfe555

Please sign in to comment.