a MIDI interface for the OPL2 Audio Board and OPL3 Duo!
To make the experience fit your profile, pick a username and tell us what interests you.
Another week has passed and there are some big changes this time. Version 1.0 is getting nearer and nearer...
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.
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.
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.
And to round things up a lot of small fixes have gone in:
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.
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.
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 »
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??
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!
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.
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 »
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.
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.
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.
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.
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.
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 »
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.
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.
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.
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.
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.
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!
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.
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.
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.
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!
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.
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.
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.
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.
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 »
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.
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
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.
Become a member to follow this project and never miss any updates