TO DO for Seq66 0.99.24
Chris Ahlstrom
2019-04-13 to 2026-04-29

    -   Change the build system to Meson.
    -   Port more Qt6-deprecation fixes from the (not yet public)
        Meson build once that works fully.
    -   Fix positioning of data pane text in the various modes.
    -   Make controller values movable in the data pane just
        like patch values. Show the number in addition to the
        name.
    -   Can we alter a selected value by forwarding the arrow
        key to the data pane for non-note events?
    -   Segfault: Open b4uacuse patchless midi, then open the
        pattern editor for guitar. Then open 1Bar-1920.midi when
        channel 0 pops up as being unavailable. Similar to the
        segfault when prompted to remap and restart. "Unavailable".
        Partly fixed: can still occur with multiple pattern editors
        plus a song editor window; fix the external song editor.
        Test this with pattern-fix, LFO, and other dialogs!
    -   On Arch, with many pattern editors and one song editor open,
        loading a new file leaves the song editor open.
    -   Issues #102, #137, #138

Features:

    -   MIDNAM? Incorporate the xml66 and midiname projects if practical.

NSM:

    -   Seq66 may be delaying responding/announcing to NSM.
    -   When creating a session, make sure playlist is copied if active.
    -   How to keep Seq66 up-to-date when ports are added back in a
        session.
    -   Should NSM really require JACK?
    -   See the Recording items below (*).
    -   Make the NSM start-up prompt time configurable or dependent on
        the number of words.
    -   See the ongoing nsmd66 and nsm66 projects.

Backlog:

    -   Takes up too much space:
        -   The buss name could be shown as a field in the event editor.
        -   Also could show channel names if provided in 'usr' file.
    -   Why do we have auto-save for the .drums file? We do not have
        that for patches. Seq66 offers no ways to modify them in-app
        at this time.
    -   Note drawing and event drawing screwed up in time when scrolled
        completely to the right.
    -   In midicvt (separate project), the c_mutegroups SeqSpec is not
        shown (24 24 00 09).
    -   Automation: verify/document Solo, Reset Sets, and Song Position.
    -   Make sure sessions.rc works as advertised; fix documentation.
    -   Event editor:
        -   Weird error cropped up; a Qt update issue? When clicking in
            the event-editors event table, a message like this appears:
            "qt.accessibility.core: Cannot create accessible child interface
            for object:  QTableWidget(0x55eaaaf6b880, name =
            'eventTableWidget')  index:  8".  This does not happen in
            the table-widgets in other tabs. Nor does it happen on another
            computer.
    -   #115 Accessing Non-Registered Parameter Numbers (NRPNs) possible?
        At present, RPN and NRPN can be selected from a list of
        control changes in the events editor. This fills in D0, but
        D1 has to be entered manually.
    -   Recording.
        -   Turning on record for a pattern makes the bottom record button
            red, but turning off the record does not make it grey again.
        -   One-shot recording during playback now works.  But one-shot reset
            then makes it act like overdub thereafter (because note-count == 1
            is the flag).
        -   There seems to be a very slight chance of too-longth notes in
            a chord if quantization (1/16) is on. Needs a better keyboard
            player (not me) to test it.
        -   Test overwrite etc. in the scenario where a recording mode can
            cause incomplete notes if one holds the note and releases it in
            the next iteration, leaving a partially-drawn note behind.
    -   Consider adding time-bg/fg-color to the palette file, using
        the 'usr' version otherwise. Not sure we like this idea.
    -   Add integration with JACK dbus. Low priority.
    -   Finish getting Windows builds in MSYS2 to work. Low priority.
    -   Oddity: drag a pattern to a new slot, and when the mouse
        hovers over the new slot, the slot number appears under it.

Playlists:

    -   Consider adding a configurable play-list auto-advance delay value?
    -   Set all contrib/midi and data/midi MIDI files to use port 0?

Ongoing efforts:

    -   Verify setmapper/setmaster for odd set sizes.
    -   Why does velocity change in data pane not work when starting from the
        left in barrage.midi? The Kepler34 "relative change" feature. This
        feature is macroed out for now. Perhaps should make it a Ctrl-Click or
        something to start it in addition to "would select".
    -   Make sure metronome buttons etc. still work. Recorded measures
        not saved.
    -   Make sure meta events are never sent via MIDI. What we see is
        that is_ex_data() events are skipped. We now allow SysEx to be
        sent, but we need a test file for it. Can improve this slightly.
    -   Add "make install" support to qbuild.sh. In progress.
    -   When zooming, try to keep the same viewport in view.  Got this working
        for horizontal seqroll and perfroll, but not for vertical (refactoring
        needed).  Try to center vertically on notes in the viewport.
    -   Make it center on notes if not visible.
    -   Can we distinguish note-insertion from movement snap, to avoid the
        "L"-then-snap-then-move samba?

Cannot duplicate or will not do:

    -   When I try to record events using the Midi Controller UC-16, seq66 is
        refusing to work and is telling me that the output bus is not
        available. The same hardware configuration is working perfectly when
        using seq64, the synth is receiving the CC signals and these events
        are recorded by seq64. [We do not have this unit]
    -   Event editor. Open the b4uacuse patchless file and the first (0)
        pattern in the pattern editor; a segfault occurs. Try it on Arch.
    -   Tempo event in track 0 does not override c_tempo_map SeqSpec.
        Actually, c_tempo_map is not really used.
        USE_SEQ32_SEQSPECS      /* stazed feature not implemented */
    -   Implement showing drum note names, similar to patch name,
        in the various edit panes. However, this gets cramped,
        so disable via the macro SEQ66_SHOW_GM_DRUM_NAME.
        But will be shown if note is manipulated in the data pane.
    -   Have a click/selection bring the pattern-editor to the front.
        Sort of fixed; only effective for the last-opened pattern
        editor.

ISSUES:

#44 "Record live sequence changes" functionality
    Currently the "record live sequence changes" only adds patterns into the
    song timeline as whole loops, starting at the last pattern loop and ending
    at the next, and ignoring queueing completely (queueing a pattern just
    adds it to the song immediately). It seems to me that a live-oriented
    sequencer like Seq66 should have the ability to record a live performance
    as accurately as possible, so that a user can simply hit the record enable
    and do their live performance, knowing that can then go back and replay it
    exactly (if they want to do a recording session for example, or perform
    the same track while focussing entirely on knob tweaking etc.) The song
    timeline already supports arbitrary start/end points for pattern "chunks",
    so it seems like this should already be possible. Thoughts?
    1. When recording live sequence changes in song mode, turning "snap" mode
    off makes the pattern block start exactly when you press the button on the
    Launchpad, like you expect, but the end point always extends out to the
    next multiple of the pattern length when you mute it again.
    2. With "snap" mode enabled, live sequence changes always snap to pattern
    length  regardless of the snap size setting in the drop-down box. The snap
    size does work when dragging and resizing pattern blocks in the timeline -
    except.
    3. ...off-by-one error in the snap size drop-down. 1/1 and 1/2 are both 1/1,
    1/3 is actually 1/2, 1/4 is actually 1/3 etc.  FIXED.
    STATUS: Partially fixed.  One can now trigger manually
    in the perfnames pane, but there are still issues to resolve.

#52 Community / discussion place?
    STATUS: Partly supported now by using github.io, but much more to be done.

#63 Option to rotate pattern numbers?
    STATUS: It works for the live grid.
    New issue: Verify that it works in other settings.

#66 Toggle MIDI Recording via CC message
    I think modes generally should be triggerable individually. Especially if
    there will be more to come in the future, it will get messy when you
    only have a single button for them.  I think that a next candidate would
    be for copy and clear mode.  In copy mode, the first grid button press
    would highlight a pattern and the second one would paste it to the
    appropriate slot.  On clear mode, the patterns could be emptied or removed
    via the grid buttons on the controller.

    We could end up with a lot of modes, perhaps more than keystrokes could
    support.  If a MIDI controller can emit specific D2 data programmably from
    0 to 127 (for Notes, D1 is the note number and D2 is the velocity; for
    Controllers, D1 is the CC number and D2 is the value), then we could
    consolidate modes in one command (and preserve the stepping through the
    modes as an alternative for less flexible controllers).

    Ideally there would be an automation control for cycling through the modes
    and one for each mode separately.  Then people could chose if they want to
    set up a control that cycles through the options or set up a control that
    instantly activates a specific mode.

    Can we leverage continuous controllers (CC) to support modifying synth
    parameters through input automation? See the new "macro" facility.

    STATUS: Partly fulfilled.

#68 MIDI controller initialization step
    STATUS: Closed, some follow-on suggestions:

    Actually I have been thinking about the mode transition logic and it would
    be nice to have support for temporary transition.
    Here is my original suggested flow

    1. Controller button pressed
    2. MIDI CC message with `on value` sent
    3. Seq66 reacts to the message and changes modes
    4. Controller button released
    5. MIDI CC message with `off value` sent
    6. Seq66 does nothing
    7. ...
    8. Same controller button pressed
    9. MIDI CC message with `on value` sent
    10. Seq66 reacts to the message and changes to neutral mode
    11. Controller button released
    12. MIDI CC message with `off value` sent
    13. Seq66 does nothing

    A temporary transition would be engaged by holding a button down on the
    MIDI controller and then releasing it later.  While the button is held
    down, Seq66 switches to the configured mode, the grid buttons can then be
    used to engage with the mode. When the button is released,Seq66 switches
    back to the previous mode and not to the neutral one.  This could be
    implemented via a timer that starts when a CC from a button press is
    released. If the button is released under a threshold amount of time then
    the mode is toggled permamently. If no `button released` CC message is
    received within a threshold amount of time then the transition becomes
    temporary and when the `button released` CC message is finally received
    then Seq66 switches back to the previous mode.

    The idea is that with a MIDI controller you could assign different
    functions to a single button.  It would also fit nicely with a Launchpad
    where apart from the grid buttons, there are "mode" buttons on the side.

#100 Seq66's MIDI timing completely falls apart at JACK buffer sizer
    larger than 128.
    STATUS: Added a timestamp to each message in the JACK
    ringbuffer (enabled by a C macro in libseq66/include/seq_features.h).
    This addes a notable burden on process and we can get buffer overflow
    errors.  Even with message timestamps disabled, the b4uacuse-stress.midi
    file can cause failure, especially when the next set is chosen.
    At minimum we should stop, clear out JACK, and panic. We found that
    there seems to be no way (using methods culled from other apps such as
    Ardour) to completely eliminate hiccups in the synchronization of
    note input and playback, due to the unavoidable lag between putting the
    note in the ringbuffer and taking it out in the JACK process callback.

#115 Accessing Non-Registered Parameter Numbers (NRPNs) possible?

    STATUS: It works for this user. As a side issue, he would like to
            be able to set data values more easily (e.g. exact number)
            than by dragging the data line.

            Also found a bug: Open brecluse.mid and then pattern #1.
            Then attempt to modify the velocity in the data pane.
            We find that many of the events were not drawn in the
            data pane when the roll was moved by the arrow keys!
            Clicking in the event pane forces redrawing.
            Using the horizontal scrollbar refreshes properly.
            Added some tricky code [flag_dirty()], as already done
            in qstriggereditor.

#128 Recording type for loop button not working
    The button on the main page for recording styles Overdub, Overwrite,
    Expand and One Shot does not change the property of the pattern. The drop
    down menu in the pattern window works fine, although Overdub is called
    Merge here, which is not ideal.

    So, it is not quite as I thought. I tested it using step input and it is a
    bit hit and miss whether it turns off the record arm at the end of the
    loop. Mostly miss and it just overdubs. It also sometimes turns the record
    arm off instantly.

    This may or may not be related to a separate problem(s) I have found with
    step input where it does not loop properly on any mode. Step input seems
    to read the loop as one more step than it actually is. So on overdub the
    extra step will appear at the beginning of the loop and the subsequent
    loops second step will appear over the a step behind. On overwrite, it
    will not overwrite till the second step of the loop and again the step
    will one behind. Expand overdubs rather than expands on step input.

    Update: Been testing the WIP branch. I am getting an issue with the expand
    when recording live midi into it. When it gets to the ninth bar, it wipes
    all the midi recorded before it except the first bar.  The same then
    happens at bars,16, 17 and 24. Always all bars before except the first. I
    did not go longer than that but you get the idea. With step entry,  there
    is a pop up which warns that events will be dropped when you reach those
    bars.  Separately, The looping with step entry is better now.

    STATUS: All issues seem to be fixed, but need to be retested.

#136 Program change shows as note in drum mode

    The Program change is the only CC I have noticed that does not have a
    way to drag up and down via a lollipop. I do not whether this is
    connected. Anyway, to reproduce

    1. Switch to drum mode
    2. Create a program change cc
    3. You can see a drum note on the piano roll that goes up and down with
       the value change,

    STATUS: Verified. Also another issue: use the event editor to
    add Program changes at various time-stamps. They all end up at 0!

#137 multisignature fake bug + UX suggestion

	OK so initially I thought it was a bug, but it turns out it is just a UX
    thing.

	Reproduce steps

	0. (optional) press play
	1. create pattern 1
	2. press play
	3. create pattern 2
	4. set signature to 3/4

    > pattern 2 will stay in 4/4 eventhough the dropdown boxes will display
    > `3` and   `4`

	When pressing stop, and re-opening the editor, the dropdown boxes
	mysteriously were reset to `4` and `4` :/

    This 'bug' made me bang my head against the wall..read the docs again..try
    various things to make the loops play with different signatures.

	Cause
    It turns out that signatures cannot be changed when playing.  However, the
    GUI allows changing the dropdowns (but the controls do not update the
    data).

	Solution
    While playing, the signature dropdowns should be grayed out (and enabled
    once pattern is no longer playing)  `<---- preferred`. NOTE:
    the time signatures work, but the time signature event is not added
    until the time-signature logging button to the left is clicked.
    This work whether the L position (progress bar) is moving or is set with a
    click in the time pane.

	Other (probably more complicated/annoying) solutions are:

	* Stop the transport when changing the signature.
	* Refactor things to allow updating signature in realtime [see NOTE
      above.
    
    STATUS: Fixed.

    EXTRA WORK (STATUS: Fixed, needs more testing perhaps):

        1. Follow up on issue #111, Time signature changes does not get
           saved on .midi file.
        2. Changing the Global Time Signature shows the changes in
           the grid slots and the seqroll, but not in the pattern-editor
           combo boxes.
        3. Re 2, changing to 3/8, saving, and re-opening shows 4/8!
           The actual time-signature event is 4/4!
        4. Hmmmm, generally only the first track has a time signature
           event. Do we need to go back to that?

#138 workflow regarding multitimbral program change + MSB + LSB

    When the transport is stopped..sending midi-notes to a pattern does record
    it to the pattern.

    However, it does not capture programchange+MSB+LSB or CC events (send from
    my MT device)

    I really like the concept of being able to export a midi-file which
    includes `program-change + MSB + LSB bank select` for each midi-channel
    (in the beginning  of the midi-file).  That way I can import the midi-file
    to my multitimbral synth (MT) for perfect playback with the right
    instruments.

    The problem is that I don't know a convenient way of doing this.  Right
    now I'm doing:

    * MT:  transmits notes on midichannel 1 to seq66
    * MT: I select the previous instrument
    * seq66: I press 'play' and 'record' on a pattern
    * MT: I select the next instrument (so it triggers a `program-change + MSB
      + LSB bank select` of the desired instrument to seq66)
    * seq66: profit! the values have been captured in the pattern (not ideal
      though, the values never end up exactly in the beginning of the pattern)
    * seq66: I have to manually move the events to beginning of the pattern
    * Rinse and repeat: I do this for every (16) midichannels

    Question: is there an easier way to do this?

    The good news is that recording notes during stopmode, increases the
    pattern-position for each note.

    Via this exact same mechanism, NRPN data would become possible (which
    re-uses CC 6 to send a value`).

    Many midi-devices transmit NRPN data for device-specific settings, so
    recording it (during stopstate) starting from a specific patternposition
    would really allow exciting control without external
    dependencies/drivers/definition-files.

    Brainstorm

    Seq66 is unique in that it treats the `.mid` file as a first-class citizen
    for project-metadata too.  In other words, the midi-file is completely
    selfcontained.  Here is an idea to allow creating easy selfcontained
    multitimbral midifiles for soundfonts/hardware midi-devices:

    How about each seq66 pattern would always update/save the last received
    `program change + MSB + LSB`-values at the beginning.
    Maybe this could be a default feature-toggle?
    This would make the above mentioned manual steps (4x16=64) redundant.
    Imagine the the speedy workflow.

    All other (older) midi editors either lack this, or require you to create
    (very timeconsuming) instrument-bank-definition files (which is an
    anti-pattern imho, as they usually never exist for your preferred
    device/soundfont/software combination).

    Can we maybe allow recording midi-events in the pattern editor (during
    stop-state?).

    This would make the above mentioned ~64 manual steps redundant.  One could
    hit record (without pressing play), receive some midi data, which would
    (over)write the values to the current patternposition.  This more modern
    workflow, allows hardware to augment the seq66 pattern-editor cursor.

    bigger picture: synths/keyboards/grooveboxes emit program change + LSB +
    MSB-events when switching patterns or instruments. Many of them also send
    midi CC snapshots (reverb/chorus/delay send values) when switching
    instruments. For example, here's my CASIO CTS-1000v synth when switching
    an instrument:

    Sends CC 0 11 + CC 32 64 + PC 96 + CC 5 20 + CC 65 0

= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

To close as pushed off to version 2:

     1 JACK Metadata MIDINAM support
    46 JACK port groups and order.
    62 PipeWire compatibility
    68 MIDI controller initialization step
    77 For building without JACK
    82 Tabs do not scale to window
    90 More consistent support for undo / redo / unmodify.
    96 MIDI Learn/Wizard as separate (?) app

MIDI version 2 considerations::

ALSA:
    -   When toggling a virtual input port, another port with the same
        number gets created.  Looks like this bug has been around for awhile.
        It also yields an ALSA unsubscribe error when disabling an input.
    -   Use const char * snd_asoundlib_version () to get the ALSA version.
JACK:
    -   Pulseaudio gone, so now the USB devices (without a2jmidid running)
        show up as "0:n system:midi_playback_n+1 'Device name'" (similar
        for 'playback') and qsynth as "1:4 qsynth:midi_00". True even if
        short port-naming.

Version 2 features:

    -   #100 Seq66's MIDI timing completely falls apart at JACK buffer sizes
        larger than 128. Added a timestamp to each message in the JACK, more to
        refactor
    -   Round-robin support for MIDI input.
    -   Use Meson/Ninja as the build system.
    -   Support for multiple languages in user-messages.
    -   Allow for building without JACK dev files installed.  Weak JACK
        support.  Seq66 dependence on the JACK ringbuffer is an issue here.
    -   Port refresh in ALSA and JACK at a minimum.
    -   #46 JACK port groups and order.
    -   Add option to start JACK if not running.
    -   #96 MIDI learn (and wizard) for creating controller maps. Separate app?
    -   Pipewire support.
    -   Live note mapping?
    -   Abletone Link support?
    -   Support for audio-clip patterns?
    -   Add keyboard configuration to MIDI Learn/Wizard.
    -   Move the Events, Playlist, Sets, and Mutes to a separate window
        (the Preferences editor?).
    -   Make main menu hide-able.
    -   Allow multiple instances of seq66.
    -   Allow multiple tunes to be loaded in seq66.
    -   #90 More consistent support for undo / redo / unmodify.
    -   Add console output for every user action.
    -   Add scripting language?
    -   Clean up kruft in setmapper/screenset.
    -   Support more than one tune?
    -   A way to lay out a pattern from one track into another tracks
        playback, to re-use the pattern on a differnt buss and channel.
    -   Support manual reconnecting, including of the control/display busses.
    -   Implement solo, FF, rewind, etc.
    -   Use std::numeric_limits instead of macros.
    -   LV2 MIDINAM support.
    -   MIDI 2.0 support?
    -   Live note-mapping.
    -   Windows build and installer. 32-bit installer cannot work!
    -   Perfect the "background recording" feature.

# vim: sw=4 ts=4 wm=4 et ft=sh
