Close

Finally there is an update on the composer module

A project log for OPL Studio - OPL2 / OPL3 MIDI Synthesizer

The ultimate dual OPL3 MIDI syntesizer with touch screen

maarten-janssenMaarten Janssen 09/06/2021 at 19:050 Comments

The last two weeks I did a lot of work on the composer module of OPL Studio. This will be the module where you can arrange your drum and melody sequences into songs. Sequences are placed on a grid where they will be shown as sequence blocks.

I had already spent some time on this module quite some weeks ago, but I got stranded when I started to make things too complicated for myself. I had started on a very complex implementation where I wanted to make draggable sequence blocks and complex selections possible in the editor. I got rid of that idea for now in order to get things done. Making the editor more fancy will be for later.

The biggest change in the compser is the song grid. This used to be handled partially in the composer app module and partially in spearate UI elements making it very complex. The sequence blocks could only be rendered as 4 beat long blocks, which made it impossible to render blocks for sequences that are longer than 4 beats. Adding insult to injury, the sequence blocks could only be aligned by 4 beats and the code wasn't built to allow for efficient repaints.

In the new code sequence blocks are handled more efficiently as small 1 beat long segments. It can render the left, middle and right sides of blocks to be more efficient with less repainting while scrolling. Another part of the song gird UI that has now been fixed thanks to the smaller sequence blocks is the play head. This is a red line that passes over whe grid while the song plays to indicate the beat being played. The play head now updates currectly as playout progresses without leaving artifacts in the UI and slowing down while scrolling.

I also want to render the sequence number on top of the block, but haven't implemented that yet.

Sequence selection

To add a sequence to the song you press and hold a cell in the song grid with the pointer. This will open a new dialog: the sequence selection dialog.

In this dialog all sequences that were created in the drum and melody sequence editors are shown in a grid of toggle buttons. The buttons show the sequence number and the pattern and colors that were assigned. Tabs on top of the dialog allow to switch between drum and melody sequences. The play button on the bottom left of the dialog can be used as a preview button for the sequence that was selected.

Right now it's finally possible to arrange sequences into songs, though the composer module is still far from being finished. There are still bugs to fix, features to implement (loading and saving would be nice!) and time needed to play with the module to see if it all works as I intended.

Should I kill some of my darlings?

Lately I've been thinking about the buttons and potentiometer controls I added. I'm not sure how useful they will be. Especially the potentiometers might have been not the best choice. They always give an absolute value which would not be ideal unless the potentiometers are always used for the same function. Otherwise rotary encoders, which give a relative up / down value would be more appropriate. Right now the potentiometers don't even have a function yet.

Also the buttons are not of any use right now, other than looking fllashy with their lights I haven't given them any function and it's not something that I'm missing right now.

So I'm still thinking that maybe I should get rid of the buttons and the pots and make it a smaller device...

Discussions