Close

Dialog Boxes and Another Sequencer

A project log for OPL2 / OPL3 MIDI Interface and Controller

a MIDI interface for the OPL2 Audio Board and OPL3 Duo!

Maarten JanssenMaarten Janssen 04/20/2021 at 15:520 Comments

Dialog Boxes

There are two big new things on the project this week. First is the possibility for the UI to show dialog boxes to the user. When an application module wants to show a dialog it ask the UI controller to pause the current UI, render the dialog and wait for user input before resuming the main UI. The dialogs themselves are smaller application modules. When the main UI is resumed the application module can ask the dialog what the user input was and take action accordingly.

The first application module to use a dialog is the patch editor. After additional changes to the Patch Controller it is now possible to change the names of instrument patches. In order to do this I added an on-screen keyboard dialog to input text. This is also a good text for suspending and resuming the main UI since there are many buttons in the dialog.

I'm thinking about maybe making the dialog box more obvious to the user by graying out the menu bar of the main window or darkening the the values of the background UI components. I'm not sure yet...

You may also notice the buttons on the bottom of the patch editor. I'm trying out whether this is a good solution for 'special actions' that you would normally find in a menu bar. The buttons don't have any actions attached to them yet, but their function seems obvious.

Melody Sequencer

In the previous log I wrote starting on the application module for the melody sequencer. The melody sequencer is now starting to take shape. What it does is record the MIDI events in 16 steps. Each step can contain up to 4 notes and there is some quantization going on to help with assigning the MIDI events to the correct step. The sequencer buttons function a bit different from the drum sequencer since you can only click a button to clear a step in the sequence.

You can set a trigger point on the sequencer by long-pressing on one of the sequence buttons. When setting a trigger point the sequence button will start to blink and the sequencer goes into record mode. As soon as a MIDI note on event is received the sequencer will start recording. This is quite handy to correct errors or to make step recordings.

At this moment it can only hold a single sequence and there are still bugs when the internal clock is used to record the sequence. Controls to change the pattern, clock divider and volume are also not yet working. Most of the work for this module has gone into making the MIDI recording work correctly.

Discussions