• Highlights, Sequencers and Accessories

    Maarten Janssen08/20/2022 at 18:12 0 comments

    Another week has passed and there are some big changes this time. Version 1.0 is getting nearer and nearer...

    Button Highlights

    The play and record buttons will now light up when they are active. This is to make them stand out more to show OPL Studio is playing and whether recording is enabled. It also makes the recording trigger stand out more in the melody sequence editor since the play and record buttons will now flash to indicate recording trigger has been set.

    The Quad Synthesizer

    Development on the new synthesizer module is progressing quickly. The main functionality is now  ready and it's a matter of cleaning things up and working out the finer details. The UI has changed a bit. The textfield with the small button has been replaced by a bigger blue or gray button that is used to select a sequence and to show whether the sequence is active. Slots can also be empty now and in this case the button to enter the sequence editor will be grayed out with a stripe pattern.

    Sequences are added to one of the sequencer slots by clicking on the slot title. This opens the sequence selection dialog that's also used by the composer module and selecting a sequence will place it in the selected slot. A new feature of the selection dialog is that you can now also select empty sequences. Doing so will not only assign the sequence to a slot, but it also opens either the drum or melody sequence editor to record the sequence.

    To finish off the new sequencer I have to make sure it's well integrated so there will be no hickups when it's playing in the background and you're navigating through the UI. I have to add the ability to save the state of the sequencer in the session manager. And I have to finish work on the retriggering.

    Home Screen Cleanup

    The home screen was getting quite crowded now I added the new sequencer module and besides I thought it would be confusing to have the sequecer, drum sequencer and melody sequencer all on the shame screen. But man I love those icons! It would be a shame to remove them. So what I did is that I added what you might call a program group on the home screen called 'Accessories' . This opens a new screen with the less frequenctly used modules: drum sequencer, melody sequencer and settings.

    Moving the two sequence editors to this new folder makes sense to me since now they are more or less part of the sequencer module. Though it will still be handy if you want to work on a single sequence.

    The Accessories group will be a convenient place as well from another module that I want to add later, post launch.

    Lots of Fixes

    And to round things up a lot of small fixes have gone in:

    • Changing a parameter in the patch editor will no longer force the note to a C when a key is held down while making the change
    • When pointer calibration is started MIDI playback and the sequencer is stopped. Notes are flushed to prevent buffering them to be play when normal operation resumes
    • There was an issue in the composer module regarding loop cueing. Cue would only take effect every 16 steps!
    • Sequence selection dialog now stops the preview when you unselect a sequence, but the preview function is still problematic in combination with the sequencer
    • When you select a sequence with the same index in a different tab of the sequence selection dialog then the button now correctly shows that it's selected
    • The composer module now also handles the new PolyMelody
    • An error where the composer would only play 1/4th of the song and then loop is now fixed
    • Hanging notes occurring when entering / exiting the patch editor have been fixed
    • The patch editor will from now on only listen to notes played on MIDI channel 1, but it now also takes into account control changes on this channel
    • The patch editor will no longer forget the patch that was being edited when you close it
    • Closing OPL Studio settings no longer causes a repaint of an empty background
    • Notes no longer get stuck in the patch linking module

  • We're Not Done Yet!

    Maarten Janssen08/07/2022 at 18:51 0 comments

    After I reimplemented the melodic sequences and allowed them to be polyphonic again, I realised how bad the old melodic sequences were! Monophonic and very static allowing almost no room to put any dynamics into the music. This simply isn't good enough to be released. I'm too much of a perfectionist to even consider putting it out there as a 1.0 release of the software.

    The good news is that the melodic sequences have now been fully reimplemented and the melodic sequencer module is almost fully updated as well. What still remains is to put back the step recording and copy / paste functionality. Also the OPS file format that saves OPL Studio sessions needs to be updated to support the new PolyMelody format, but this will be a trivial change now the sequence data is much more simple to save and load. Lastly the composer module needs some changes to support the new PolyMelody sequence format and also this will be a relatively simple change.

    Another Sequencer

    So what's taken me all this time then since the last log if most changes were quite simple? Well, I did some more fundamental changes in the way how sequences are managed, edited and played. When all was almost set and done it made a lot of sense to also add a new 4-track sequencer that I was hinting at in the previous log.

    The new sequencer can play up to 4 different drum or melodic sequences at a time and also play them in the background, for example when you're editing instrument patches or changing the synthesizer setup. You can immediately hear your changes!

    The new sequencer also adds a lot of potential for live playing with OPL Studio. You no longer have to prepare a song in the composer module beforehand (you still can), but now you can start playing a bunch of sequences, add more, change them, edit them all on the fly! The new PolyMelody sequence format has opened up so much more freedom that it feels wrong not to add the new sequencer module. 

    This doesn't mean that the current drum and melody sequencers will be removed. They will remain in place as the editors for your individual sequences.

    The new 4-track sequencer is still in an early stage, but this screenshot should give you an idea. Of course the familiar play / stop and tempo controls are there. In addition there is a control that lets you retrigger the sequencer every n steps. Below you see the four sequencer slots. Each slot can be set to any of the drum or melodic sequences and they will be represented by a big toggle button in the color and pattern associated with the sequence. The buttons can be click to toggle playing or muting a sequence. A little progressbar shows how far along the sequence playback is. Clicking the ... button opens the sequence selection dialog that's also used by the composer module and it allows you to change the sequence that's assigned to the slot. Lastly below each sequence button there is a big button to open the sequence editors to edit the sequence that's playing in the given slot.

    Some Future Changes

    Now that sequences have been completely refactored one thing that still remains 'legacy code' are the drume sequences. These are stored as very simple byte arrays where individual bits tell whether a drum sound should be played on a sequence step. This made sense at the time when I really wasn't sure about the demand on the Teensy's RAM and therefor I wanted to be very conservative on the memory footprint of all the things I needed to store. 

    It now starts to make a lot of sense to store the drum sequences also in the new PolyMelody format, same as the melodic sequences. This would get rid of the limit of having just 8 drum tracks per sequence and also allow for things such as volume or panning changes in a drum sequence. Again it would also make all sequece code more simple since there will be just a single type of sequence data to handle. Yet it means more refactoring to come and I must make sure first that the additional memory requirement of using the PolyMelody format...

    Read more »

  • Return of the Polyphonic Sequences

    Maarten Janssen07/23/2022 at 14:44 0 comments

    Yep, so as the title says polyphonic melody sequences are back! A long time ago I removed them since my first implementation was really cumbersome and required relatively a lot of memory. So to get things done I settled with only monoplhonic sequenses until I would figure out 'how to do it'. Well that time is now! 

    Unfortunately no fancy new screenshots or videos this time. They will follow next time once I have the update done...

    For a few weeks I have been thinking about how to add back support for polyphonic melody sequences that allow for a lot of flexibility as well as being friendly to the memory usage. The new melody sequences that I'm now working on are basically just straight up recodings of the MIDI events that are received on a certain channel. Of course that's putting it a bit too simplistic since there is some compression going on as well...

    The compression is what has been making this new implementaion take such a long time to happen. The code to handle the melody sequences has become considerably more complex if you campare it to the monophonic melodies and I wanted to test my solution before putting it into the OPL Studio code base. Since I'm posting this, obviously testing was successful and I've gone forward with the implementation. 

    So apart from being polyphonig; allowing multiple notes to play at the same time, what other benefits are there to this new sequence format??

    • No enforced limit on the number of simultaneous notes
    • Greater recording resolution, from sequence step to MIDI tick
    • It records MIDI control changes such as pitch, modulation, volume, panning
    • Allows to also record analog inputs from CV/T in the future
    • The format makes it easier to export to *.MID, *.IMF, or *.DRO files in the future when I add an option to export songs

    The new way to store melody sequences does mean some considerable refactoring is needed on the editors and overall playback functionality. Since the new sequences are recording on a 6x greater resolution; MIDI tick instead of sequence step, it means some big changes, also for drum sequences.

    It also means that some of the functions in the melody sequence editor maybe don't make a lot of sense anymore. Volume and panning are no longer set for the full sequence. Also note length is no longer relevant, except maybe in step recoding mode. What I will do with these I'm not sure yet...

    Overall I'm really happy with the progress with the new sequence format so far. Even if the UI is not fully aligned with it yet, it feel much better just playing around with OPL Studio knowing that it there are less limitations holding you back!

    Sequence Parameter Editor

    With the new sequences I can also start implementing a long time feature that I want: editing pitch, modulation, volume etc per sequence step. In the sequence editor I want to allow you to open a modal window to edit sequence parameters over time. This will probably be a set of graphs where you will be able to drag set points to change for example volume over time.

    The new sequence format allows this, but since that data is compressed in memory it makes editing these detailed sequence parameters a lot more complex in code, so this will still take a while to implement.

    New Sequencer Module

    Another idea that I want to implement is to group the drum sequencer and the melody sequencer together into a new sequencer module. This new sequencer can then be used for a live performance and the sequence composer will then be just to create longer songs from sequences 'off line'. 

    It should allow for 4 different sequences to play at the same time with simple controls aimed at playing live with OPL Studio. Big sequence buttons that show the sequence color and pattern that's playing,  reusing the sequence selection from the composer module, etc.

    From the sequencer you can launch into the drum and melody sequencers to edit sequences and at the same time it sould make sequence editing a better experience. Currently only a dingle drum and a single melody...

    Read more »

  • Beta Testing Time!

    Maarten Janssen07/11/2022 at 13:48 0 comments

    Wow it almost feels embarasing to write an update after such a long time! So much time has passed that I'm sure that I'm going to forget mentioning many of the project updates from the past months. 

    More on Settings

    There is now a new settings panel for OPL Studio settings that allows you to change the type of OPL board you're using. The default will be double OPL3 for the OPL3 Duo! board, but if you're using an OPL2 Audio Board with the OPL Studio then here you can change it to the single OPL2 setting. This also allows you to change whether to load 2-OP instruments vs 4-OP instrument or no default instruments at all. In a later version of the software I also want to add the ability to load instrument banks from the SD card on startup.

    At the same time OPL2 Audio Board support is now finally working correctly after some OPL2 specific timing issues were fixed.

    Next to OPL and instrument settings the clock setup has moved from MIDI setting to OPL Studio settings since it made more sense here.

    The area with general settings is still a bit empty with only the option to enable / disable the startup chime and of course there is a factory reset option in case you want to reset to default settings.

    Emergency Recovery

    Speaking of factory reset... There is now a recovery function that will come in handy in the unfortunate case where settings have been messes up or where the pointer calibration has gone wrong and the touch screen does not function correctly. You can enter recovery mode by holding the panic button on the back of the device while booting. This will reset all settings to default and launch the pointer calibration.

    Composer Updates

    In terms of modules the composer has seen the most updates over the past weeks. There are now mute buttons for each track and there is now copy / paste functionality. Copying and pasting works by first selecting one or more sequences by clicking on them in the song grid. The selected sequences can then be cut, copied or deleted. After cutting or copying the selection can be pasted into the song by pressing paste and the position in the song grid where to place the selected sequences.

    The composer also has better integration with MIDI timing events. For example when the song position is updated the composer will jump to that location in the song grid. It is now also possible to scroll through the song with the second rotary controller, even during playback.

    OPL and MIDI Controller Updates

    On the lower levels of OPL Studio there have also been many improvements. One of my long term annoyances which was that some instruments were lingering at at a very low volume after stopping a note, has been fixed. This was caused by the frequency of the OPL channel not being reset causing the OPL to still make sound at a very low volume even after the release of a note. The OPL controller now calculates how long the release of a note will take and after that time resets the frequency to make sure the note has really been stopped. 

    Another important fix has been in the external MIDI clock. When the external MIDI clock was used it would sometiimes happen that a feedback loop was occurring in the software which caused the clock to go crazy and it couldn't be stopped anymore. Luckily this has been fixed now :)

    The MIDI recording trigger has returned to the melody sequencer. I had removed it some time ago since it had become problematic in combination with step recording. The recording trigger can be set by going into record mode and long pressing the play button. Recording will not start, but the active sequence step where recording will start from will start blinking and can be changed by clicking on another step. As soon as a MIDI note on event is received on the input channel of the sequence it will start the recording.

    Updates on the External Synthesizer Inputs

    I'm not sure if I mentioned this part before, but on the external synth (CV/T) setup there have also been some updates that now allow you to configure one of the...

    Read more »

  • Enclosure

    Maarten Janssen02/27/2022 at 19:49 0 comments

    The big update for this week is that I made a really nice looking enclosure for OPL Studio (if I do say so myself). I had the plans to make an enclosure for OPL Studio ever since I started working on the first set of prototype PCBs last year. The 3D printer I had at the time, however, wasn't reliable enough to print even a simple object. Since a month or so I have a new Prusa Mini which enables me to finally get started on the enclosure. So sately I have spend many of my after work hours learning FreeCAD and getting familiar with my new 3D printer and now it's paying off!

    The enclosure for OPL Studio is a bezel printed in one piece where the top and bottom PCBs are screwed in to. So no need anymore for spacers between the boards. Of course there are the cutouts in the back for buttons and connectors.

    On The Software Side Of Things

    Software wise there are some small updates since last week. Some cleanup of old code and some improvements for melody sequences. When the melody sequencer is active it will now also listen to MIDI volume and panning changes and apply the change to the sequence that's being edited or all sequences that are assigned to the MIDI channel where the change happened. Whether the update happens only on the sequence being edited or all sequences listening to the MIDI channel is configurable in the MIDI settings.

  • Testing, Testing, Testing

    Maarten Janssen02/21/2022 at 18:40 0 comments

    New Prototype PCBs

    The new prototype boards have shown up and I have been busy assembling a new OPL Studio.

    This new batch is again better than the previous one with only two small issues to tackle. First one is really simple and an unfortunate mistake where I left the hole for the screen just 1mm too small for the LCD to fit. The second one was removing the driver transistors for the MIDI activity led. Apart from these mistakes the new boards are working great! Previous issues with noise caused by the PWM signal of the LCD backlight is also fixed and with some extra testing and trying out filter capacitors it looks like also the noise issues caused by SPI and the tone() function appear to be fixed.

    Testing, Bug Fixing and Refactoring

    Most time I'm now spending on testing the OPL Studio by (attempting to) making music. (I'm not very musical). Once I started to use the device more like a real user would I found some serious issues that I had overlooked. The most serious being how the code was keeping track of which notes were playing. In MIDI land when you play a note you keep track of it using its channel and the note index. That way you know when a note off event occurs which note to stop. On the OPL Studio this gets more complicated, for example due to the linked patches where you can trigger the same note again with a delay, or where you can overlap sequences and play the same sequence multiple times. All this meant that it was relatively easy to confuse the player and clubber notes resulting in really choppy playout. It was also not possible to mix MIDI playback with sequence playback. 

    This was quite a fundamental problem that turned into a substantial refactoring of the MIDI and OPL interface code. It resulted in separating the MIDI channels from the internal channels used by OPL Studio to play sequences. Sequences still depend on MIDI channels, but only as an input source, for example while recording. Playback will happen on one of eight internal channels. 

    After refactoring I also enabled channel after touch and modulation. These will apply a vibrato to the channel. It will now also be relatively simple to implement external synth control over these parameters where you could control both the amplitude and frequency of the vibrato.

    The clip below plays a short MIDI file with the improved MIDI and OPL interfaces.

    Future Upgrades

    In the future, if there is enough RAM left, what I want to do is to allow for more granular control over sequences. Currently sequences do not register pitch changes, volume changes or after touch, but it would be great if these effects are also recorded and editable for more interesting sounds. I have sketched out some ideas on how to do this, but I will leave it for later until after the initial OPL Studio is ready. Ow and also polyphonic melody sequences must be added back! Things for the first software update...

    While playing around another big shortcoming was the song limit in the composer. '256 bars ought to be enough for anybody...' what was I thinking! So next improvement will be on the composer module to allow for longer songs.

    Getting Ready for Production

    All in all the OPL Studio project is finally getting ready for its initial release. I will spend still a few weeks to play with the device, do more bug fixing to get it into a good working state, get the final PCBs produced and then it will be time to release the OPL Studio to everyone!

  • Session Manager

    Maarten Janssen01/23/2022 at 16:11 0 comments

    The past weeks I've started to work on the Session Manager. This is the module where you can save, load, import and export the OPL Studio session that you're working on. 

    The Session Manager gives a tree view of all items in the current OPL Studio session: instrument patches, sequences, etc. You can save or load an entire session as well as export selected parts from a session or import from other sessions. It's very flexibe and this part of the UI took a long time to develop. Espcially the different dialog boxes interacting with each other in this module and error handling was a lot of work.

    Splash Screen and Logo

    I made a new logo for OPL Studio that I also might start using for the OPL3 Duo! boards. The logo is inspired by Adlib's 'speeding music note' logo. I wanted to have two notes for my logo since OPL Studio uses the OPL Duo! board that has two OPL3 chips and thus double the power. I'm not the greatest artist, but I'm very happy with the result! Together with a little inspiration from the Windows 3.1 boot screen I now have a splash screen for when the OPL Studio is first switched on.

    New prototypes

    In the next two weeks a new batch of prototype PCBs will arrive. These will fix issues that I had with the previous batch, such as the MIDI ports not, some missed traces on the main board etc. At least I hope it will fix all my previous mistakes and also that it will provide a cleaner sound. I left a bunch of pads on the PCB for me to experiment with different filter setups to get rid of the SPI and PWM noise on the power rail that bleeds through into the OPL3 Duo. 

    I hope that by that time I will also have my new 3D printer, finally, so I can also think about a bezel that closes off the side to give a nicer finish.

  • External Analog Controls

    Maarten Janssen12/24/2021 at 14:02 0 comments

    This is a long overdue project update... The past couple of weeks haven't been very kind to me where every couple of days something in or around the house broke down. Also my laptop wasn't safe from this curse and the hinges of its screen snapped off completely. This left me with only a very old HP laptop that wasn't really up to the task anymore to do any serious developement. Never the less I did mandage to put in some nice updates!

    Power and Panic

    The 2nd prototype has two buttons that so far had no function. A power button to switch the thing on and off and a panic button that you can press when the OPL 'hangs' due to bad settings or broken MIDI. Both buttons are now functioning.

    The power button does as you would expect in a graceful way: it fades the screen and volume in and out as the OPL Studio is powered on or off. and refreshes the screen in the background to hide the ugly screen build up.

    When you press the panic button the OPL3 Duo will be reset and all MIDI will be flushed to stop hanging notes.

    Some UI Tweaks

    There are also some small UI tweaks. First of them is a performance improvement for controls to prevent excessive repaints when possible. Another update has to do with the element being focused so its value can be altered with the rotary controls. Previously the focused element would show its value in bright white, but this would not make it stand out enough. So now the active element also gets a blue background for the value.

    Compound Instrument Editor

    The Compound Instrument Editor was completely overhauwled into the Synthesizer Setup. The Synthesizer Setup will now be the place to edit compound instruments which will from now on be called 'Linked Patches'. The UI is more compact now with some new controls to select between disabled, melodic and drum links. The Synthesizer Setup will also be the place where you can setup the functions of the 6 analog CV/T inputs of the OPL Studio. This UI is not ready yet in this update.

    Analog CV/T Input Handling

    The OPL Studio has 6 CV/T (control voltage / trigger) inputs that you can use to control various parameters such as channel frequency, output level, ADSR envelope, etc. These functions will all be configurable from the Synthesizer Setup module.

    Getting this part of the OPL Studio implementad had been a pain for a long time, but in this update it's starting to work. The hardware part that I designed for the 2nd prototype is working correctly and you can feed the inputs a voltage between 0v and 8v to control what ever function if configured for the input. In the demo at the end of this update I'm showing a very simple setup with a potentiometer that sends a control voltage between 0v and 5v to override the output level of the 3rd operator of a patch. This is very fun to play with and can give some wonderful sounds!

    Now since you can connect any kind of home brew control voltage generating thing to the CV/T inputs I also added a small testing and calibration wizard to the settings screen. This will allow you to calibrate your analog inputs so you can make use of the full range and you are not limited to always having to use a 0v to 8v scale.

    A new mic!

    I also baught a new microphone to make better recordings of the audio since I wasn't really capable to make good stereo recordings. The drivers of my laptop always seemed to do something 'smart' with the audio that broke the stereo recording and the Chinese quality USB dongle I had was only doing mono recording despite its promised spec (what a surprise).

    I now have a RØDE AI-Micro for recording that's giving me excellent results. In fact it shows how much noise the OPL Studio is generating! Especially the PWM signals that control the LCD screen brighness and the signals going to the internal speaker are causing noise on the power line that's audible when you make a recording. This is why you can hear the clicks from the stylus in the video below while I'm recording only the audio from...

    Read more »

  • Panning, Facelifts and Menu Bars

    Maarten Janssen11/14/2021 at 15:54 0 comments

    This week I've taken a break from working on the Session Manager module and SysEx events to import and export your work on the OPL Studio. I had some ideas for the drum sequencer from some time already and this week I decided to work on them.

    What I wanted to do is to add a setting for panning on each drum track and to change the layout of the module to make some room for the panning slider and to lay the controls out in a more logical order. 

    While I was changing the layout of the drum sequencer I also made a few tweaks to the copy / paste functionality. You can copy a single bar, a single track or a complete sequence and there now is a single paste button that shows what kind of data is in the copy buffer.

    Adding panning gives a new dimension to the drum sounds. I liked this so much that I decided to give the melody sequencer the same treatment.

    At the same time I also added the menu bar with clear, copy and paste functionality that the drum sequencer also has. The melody sequencer was lacking this for a long time already.

    I also made some improvements to the code while making these changes. For example it turned out that there were some big issues in the compound instruments that prevented sub instrument panning to work, I aligned the way volumes and pannings are handled and fixed a bug where the compound instrument module would just crash after changing a drum patch.

  • Demo of the 2nd Prototype

    Maarten Janssen10/31/2021 at 17:46 0 comments

    During the last week I've fixed all the issues I had with the new prototype PCBs that I ordered. I still need to make some final adjustments and the I will order a new small batch that will hopefully be the final prototype. 

    In the mean time I also recorded a small demo to show the second prototype and how I create a simple Jill of the Jungle inspired beat

    Transmitting the internal clock over MIDI

    It is now possible to transmit MIDI clock events when the internal clock is used to sync other devices. When enabled also start, stop and continue events will be sent. When I was testing the transmission of the MIDI clock I found an issue in the internal clock that I was sort of expecting. I had noticed that the internal clock seemed to start drifting over time and this was confirmed by the clock that I was sending. The fix was simple enough: just using a higher resolution timer fixed the problem.