Skip to content

Commit

Permalink
Add loop L/R automation, more work on issue #114.
Browse files Browse the repository at this point in the history
  • Loading branch information
ahlstromcj committed Aug 13, 2023
1 parent e5c538c commit 08a16ce
Show file tree
Hide file tree
Showing 11 changed files with 210 additions and 104 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# README for Seq66 0.99.8 2023-08-09
# README for Seq66 0.99.8 2023-08-13

__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,6 +82,8 @@ Windows, and using a conventional source tarball.
## Recent Changes

* Version 0.99.8:
* Issue #114: Adding display of shortcut key to tool tips.
* Added automation for the main window Loop button.
* Fixed seqroll drawing errors introduced in adding time-sig support.
* Fixed not setting up SIGINT in qseq66, which prevented a proper
shutdown.
Expand Down
4 changes: 3 additions & 1 deletion TODO
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
TO DO for Seq66 0.99.8
Chris Ahlstrom
2019-04-13 to 2023-08-09
2019-04-13 to 2023-08-13

UI:

Expand All @@ -10,6 +10,8 @@ UI:
- 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.
- Make sure L/R looping buttons (main and song) works.
- Clarify the two transpose button in the song editor.

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

Expand Down
6 changes: 3 additions & 3 deletions libseq66/include/ctrl/automation.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
* \library seq66 application
* \author Chris Ahlstrom
* \date 2018-11-18
* \updates 2023-03-18
* \updates 2023-08-13
* \license GNU GPLv2 or above
*
* This module defines a number of constants relating to control of pattern
Expand Down Expand Up @@ -212,8 +212,8 @@ enum class slot
tap_bpm, /**< 26: Tap key for estimating BPM. */
start, /**< 27: Start playback. Compare to playback above. */
stop, /**< 28: Stop playback. Compare to playback above. */
reserved_29, /**< 29: Was the second snapshot key. */
toggle_mutes, /**< 30: Song mute, unmute, and toggle? TODO. */
loop_LR, /**< 29: Toggle looping between L/R markers. */
toggle_mutes, /**< 30: Song mute, unmute, and toggle? */
song_pointer, /**< 31: Reposition the song pointer. TODO. */

/*
Expand Down
5 changes: 3 additions & 2 deletions libseq66/include/play/performer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
* \library seq66 application
* \author Chris Ahlstrom
* \date 2018-11-12
* \updates 2023-07-16
* \updates 2023-08-13
* \license GNU GPLv2 or above
*
* The main player! Coordinates sets, patterns, mutes, playlists, you name
Expand Down Expand Up @@ -2661,6 +2661,7 @@ class performer
mapper().off_sequences();
}

std::string automation_key (automation::slot s);
std::string sequence_label (seq::cref seq) const;
std::string sequence_label (seq::number seqno) const;
std::string sequence_title (seq::cref seq) const;
Expand Down Expand Up @@ -3754,7 +3755,7 @@ class performer
automation::action a, int d0, int d1,
int index, bool inverse
);
bool automation_reserved_29
bool automation_looping
(
automation::action a, int d0, int d1,
int index, bool inverse
Expand Down
12 changes: 5 additions & 7 deletions libseq66/src/ctrl/midicontrolin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
* \library seq66 application
* \author Chris Ahlstrom
* \date 2018-11-23
* \updates 2021-12-02
* \updates 2023-08-13
* \license GNU GPLv2 or above
*
* MIDI control container:
Expand Down Expand Up @@ -74,7 +74,6 @@
#include <iomanip> /* std::setw() manipulator */
#include <iostream> /* std::cerr */

#include "cfg/settings.hpp" /* seq66::rc() rcsettings getter */
#include "ctrl/keycontainer.hpp" /* seq66::keycontainer class */
#include "ctrl/midicontrolin.hpp" /* seq66::midicontrolin class */

Expand Down Expand Up @@ -238,7 +237,7 @@ midicontrolin::show () const
using namespace std;
int index = 0;
cout
<< "MIDI-In container (size " << m_container.size() << "): " << endl
<< "MIDI-In controls (size " << m_container.size() << "): " << endl
<< "Index; MIDI key; Keystroke (name, action, slot, code); stanza"
<< endl
;
Expand All @@ -247,15 +246,14 @@ midicontrolin::show () const
const midicontrol::key & k = mcpair.first;
const midicontrol & mc = mcpair.second;
int status = k.status();
int d0 = k.d0(); // key::d1() removed
int d0 = k.d0(); /* key::d1() removed */
cout
<< "[" << setw(3) << hex << right << index << "] "
<< "0x" << setw(2)
<< setfill('0') << hex << status << setfill(' ')
<< " " << setw(2) << hex << d0 << " " // << setw(2) << hex << d1
// << " "
<< " " << setw(2) << hex << d0 << " "
;
mc.show(); /* shows the key and midi control */
mc.show(); /* key & midi control */
++index;
}
}
Expand Down
30 changes: 22 additions & 8 deletions libseq66/src/play/performer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
* \library seq66 application
* \author Chris Ahlstrom and others
* \date 2018-11-12
* \updates 2023-07-17
* \updates 2023-08-13
* \license GNU GPLv2 or above
*
* Also read the comments in the Seq64 version of this module, perform.
Expand Down Expand Up @@ -886,6 +886,18 @@ performer::put_settings (rcsettings & rcs, usrsettings & usrs)
return true;
}

/**
* A helper function for the user-interface, this function retrieves the
* name of the keystroke for a given automation control.
*/

std::string
performer::automation_key (automation::slot s)
{
int index = slot_to_int_cast(s);
return m_key_controls.automation_key(index);
}

void
performer::playlist_filename (const std::string & basename)
{
Expand Down Expand Up @@ -9107,15 +9119,20 @@ performer::automation_stop
}

bool
performer::automation_reserved_29
performer::automation_looping
(
automation::action a, int d0, int d1,
int index, bool inverse
)
{
std::string name = "Reserved 29";
std::string name = "Loop L/R";
print_parameters(name, a, d0, d1, index, inverse);
return false;
if (! inverse)
{
bool loopy = looping();
looping(! loopy);
}
return true;
}

bool
Expand Down Expand Up @@ -9639,10 +9656,7 @@ performer::sm_auto_func_list [] =
{ automation::slot::tap_bpm, &performer::automation_tap_bpm },
{ automation::slot::start, &performer::automation_start },
{ automation::slot::stop, &performer::automation_stop },
{
automation::slot::reserved_29,
&performer::automation_reserved_29
},
{ automation::slot::loop_LR, &performer::automation_looping },
{
automation::slot::toggle_mutes,
&performer::automation_toggle_mutes
Expand Down
59 changes: 36 additions & 23 deletions seq_qt5/forms/qperfeditframe64.ui
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,9 @@
<height>16777215</height>
</size>
</property>
<property name="toolTip">
<string>Show triggers at half height. [ v ]</string>
</property>
<property name="text">
<string>-</string>
</property>
Expand All @@ -162,6 +165,9 @@
<height>16777215</height>
</size>
</property>
<property name="toolTip">
<string>Reset triggers to normal height. [ 0 ]</string>
</property>
<property name="text">
<string>0</string>
</property>
Expand All @@ -175,6 +181,9 @@
<height>16777215</height>
</size>
</property>
<property name="toolTip">
<string>Double the height of triggers. [ V ]</string>
</property>
<property name="text">
<string>+</string>
</property>
Expand Down Expand Up @@ -369,7 +378,8 @@
</size>
</property>
<property name="toolTip">
<string>If active, the piano roll scrolls to follow progress bar.</string>
<string>If active, the piano roll scrolls to
follow progress bar.</string>
</property>
<property name="text">
<string/>
Expand Down Expand Up @@ -404,7 +414,8 @@
<enum>Qt::NoFocus</enum>
</property>
<property name="toolTip">
<string>Zoom out horizontally in the piano roll.</string>
<string>Zoom out horizontally in the piano roll.
[ z ] The 0 key resets zoom.</string>
</property>
<property name="statusTip">
<string/>
Expand Down Expand Up @@ -432,7 +443,8 @@
<enum>Qt::NoFocus</enum>
</property>
<property name="toolTip">
<string>Zoom in horizontally in the piano roll.</string>
<string>Zoom in horizontally in the piano roll.
[ Z ] The 0 key resets zoom.</string>
</property>
<property name="text">
<string/>
Expand All @@ -454,9 +466,9 @@
</size>
</property>
<property name="toolTip">
<string>Toggles painting mode. An alternative to holding
the right mouse button or using the &quot;p&quot; and &quot;x&quot;
keys.</string>
<string>Toggles painting mode. Or hold the
right mouse button. [ p to enter, x
to leave ]</string>
</property>
<property name="text">
<string>Enter</string>
Expand Down Expand Up @@ -486,8 +498,8 @@ keys.</string>
</property>
<property name="toolTip">
<string>Turns on &quot;song record&quot; snap. An added
pattern snaps to the full length of the sequence like Seq24
(with snap set to &quot;L&quot;) or to the snap setting.
trigger snaps to the full length of the
pattern or to the snap setting.
Growing occurs at snap length.</string>
</property>
<property name="text">
Expand Down Expand Up @@ -516,11 +528,10 @@ Growing occurs at snap length.</string>
<enum>Qt::NoFocus</enum>
</property>
<property name="toolTip">
<string>Selects the movement and sizing snap value.
&quot;L&quot; indicates full length. &quot;1/N&quot; means 1/Nth of a measure.
Also affects the L/R markers, except that &quot;L&quot; means
&quot;1 measure L/R&quot;. Use &quot;L&quot; only for patterns no longer than
a few measures!</string>
<string>Selects the movement and sizing snap
value. &quot;L&quot; = full length. &quot;1/N&quot; means 1/Nth
of a measure. Affects the L/R markers. Use
L only for short patterns.</string>
</property>
<property name="currentIndex">
<number>-1</number>
Expand Down Expand Up @@ -566,9 +577,8 @@ a few measures!</string>
</size>
</property>
<property name="toolTip">
<string>The number of semitones to transpose the performance,
for transposable patterns. The transposition is done at
playback time, on the fly.</string>
<string>The number of semitones to transpose the performance, for transposable patterns.
Transposition is done during playback.</string>
</property>
<property name="currentText">
<string/>
Expand All @@ -593,7 +603,8 @@ playback time, on the fly.</string>
<enum>Qt::NoFocus</enum>
</property>
<property name="toolTip">
<string>Sets looping between the L and R markers.</string>
<string>Sets looping between the L and R
markers.</string>
</property>
<property name="text">
<string>Loop</string>
Expand Down Expand Up @@ -704,7 +715,8 @@ playback time, on the fly.</string>
<enum>Qt::NoFocus</enum>
</property>
<property name="toolTip">
<string>Expand and copy between the L and R markers.</string>
<string>Expand and copy between the
L and R markers.</string>
</property>
<property name="text">
<string/>
Expand Down Expand Up @@ -732,7 +744,8 @@ playback time, on the fly.</string>
</size>
</property>
<property name="toolTip">
<string>Expands the piano roll to the right to allow more room for editing.</string>
<string>Expands the piano roll to the right
to allow more room for editing.</string>
</property>
<property name="text">
<string>--&gt;</string>
Expand Down Expand Up @@ -784,7 +797,7 @@ playback time, on the fly.</string>
</size>
</property>
<property name="toolTip">
<string>The transposition value for Trigger Transpose.
<string>Transposition value for Trigger Transpose.
Range: -60 to +60 (5 octaves each way).
Apply it to a trigger block via Ctrl-right-click.
To reset, set to 0 and apply it.</string>
Expand All @@ -806,9 +819,9 @@ To reset, set to 0 and apply it.</string>
</size>
</property>
<property name="toolTip">
<string>Shows the duration of the song, which depends
on the longest track or the Song layout. Clicking
on this button toggles between H:M:S and B:B:T
<string>Shows the duration of the song based
on the longest track or Song layout.
Click to toggle between H:M:S and B:B:T
format.</string>
</property>
<property name="text">
Expand Down
Loading

0 comments on commit 08a16ce

Please sign in to comment.