-
We're Not Done Yet!
08/07/2022 at 18:51 • 0 commentsAfter 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 for drum sequences will not tip memory consumption over the edge, especially on a Teensy 3.6.
But this will come later after the 1.0 release and this time I mean it!!
-
Return of the Polyphonic Sequences
07/23/2022 at 14:44 • 0 commentsYep, 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 sequence will be played. So while editing a drum sequence the melody sequence that is active in the melody sequence eidtor will also play and vice versa. It would be nice if you could hear not just one sequence, but up to 3 other sequences while editing it could be really benefitial and that's what the new sequencer module should allow as well.
-
Beta Testing Time!
07/11/2022 at 13:48 • 0 commentsWow 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 CV/T inputs as a clock source or as a gate input to start / stop the internal clock. All CV/T inputs that are in trigger mode now also have the ability to be set to trigger on the rising or falling edge of a gate signal.
Randomizer
One of the followers of the project gave me the suggestion of building a parameter randomizer for the patch editor. I thought this was a great idea that wouldn't take a lot of effort to implement. So now in the patch editor you can open the randomizer that allows you to select the operators and parameters to randomize and with one click you will get a completely random patch. It's great to get some inspiration for new patch setups!
Any Hardware Updates?
On the hardware side nothing has really changed since the last log, except that there is new a trim piece around the LCD. I added this due to the last batch of prototype PCBs that I had made still having issues with the hole for the LCD. Instead of making more tweaks I opted for making the hole big enough to fit a small 3D printed bevel to hide any imperfections. But apart from that nothing has changed on the electronics and only some very minor tweaks on the 3D printed enclosure.
Beta Time!
Probably the biggest update of them all is that now the software has hit version 0.92 and I've sent some of the earlier PCBs to a few people who've been following the project to get some feedback. So that also means that it's time to update the website, completing to write the assembly manual and start on the user manual. I should also make some more demo videos...
I'm getting a small batch of OPL Studio kits ready for Tindie. This is the scary / fun part where there are boxes full of components in my work room waiting to get packed into kits that in a month or two will be shipped to some of you and where I hope that everyone will enjoy using OPL Studio as much as I did creating it and playing with it!
-
Enclosure
02/27/2022 at 19:49 • 0 commentsThe 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
02/21/2022 at 18:40 • 0 commentsNew 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
01/23/2022 at 16:11 • 0 commentsThe 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
12/24/2021 at 14:02 • 0 commentsThis 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 the OPL3 Duo.
I've already solved some of these noise issues, but it's still an ongoing effort to make the device more quiet for the final prototype.
-
Panning, Facelifts and Menu Bars
11/14/2021 at 15:54 • 0 commentsThis 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
10/31/2021 at 17:46 • 0 commentsDuring 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.
-
The 2nd Prototype: Some Bodges Required
10/23/2021 at 13:38 • 0 commentsFinally the PCBs of the 2nd prototype arrived! As you can see it's quite a big change compared to the first prototype. All the potentiometers and buttons are gone in favor of two rotary encoders and the Eurorack inputs have moved onto small plugin boards. What I'm most excited about is the front panel. It's the first time I'm trying to make one.
I did however make quite a number of mistakes while designing the board. For starters I completely forgot the connections for the power and panic buttons and the connection from the Teensy to the mosfet that powers on the device. Oops! Nothing that a few bodge wires won't fix however.
Next problem was with the LEDs. I'm not sure what I was thinking while working on the schematic, but I messed up. Long story short the LEDs where on when they should be off and vice versa. Swapping the NPN transistors for PNP transistors also got that problem fixed. Except for the bi-color LED that indicates MIDI activity. I used the wrong footprint and had to bend some wired to make it work. I also swapped the green LEDs I initially installed for some red ones I had lying around since the green ones were so bright they were hurting my eyes.
Then still the rotary encoders are a bit to eratic for my liking, the footprint of the little beeper is too large and the SPI bus is having some issues, yet I got it all to work! :)
Now the electrical side is all good, next came some physical issues. The front panel didn't quite fit as intended, though it came pretty close. With some filing to allow the screen to fit and some dremeling to make room for the MIDI plugs the front panel fits nice and snug!
For my first time making a front panel I'm really happy, but I also thinks that it looks very plane and boring. Maybe it needs a more interesting graphics than the double note I took from my OPL3 Duo! board. I'm also thinking of trying a black front panel to make the screen stand out more and make the graphics really pop.
With every error I found I've immediately gone back to my KiCad design files to make the changes so I won't mis any changes I make and so another run of prototypes within a week or two to hopefully get the final issues ironed out.
In the mean time I also hope to find a slightly taller connector for the screen or think of another way to connect it. Right now the screen is pressed into the connector on the main board just barely. Also the plastic screws and standoffs really need to go and be replaced with metal ones.
Saving and Loading Sessions
Up to now the OPL Studio is not yet able too save or load anything other than instrument patches. That's of course really annoying when you're working on a bigger project. You don't want to start from scratch every time you power on the device. So besides working on the prototype I've also put some time in allowing to load and save sessions.
The first step I've taken is to allow other devices to send system exclusive (sysEx) MIDI events to the OPL studio. These SysEx events can contain and data the OPL Studio works with, such as instrument patches, drum or melody sequences and songs, but through SysEx messages you can also directly control the OPL3 chips. Of course the OPL Studio also needs to be able to send these SysEx events and allow you to save and load sessions to the SD card.
The Session Manager will be the new module that I'm working on that allows you to save and load a session from SD or send particular settings as SysEx events. Receiving SysEx events can of course happen and any time and it will immediately update the UI. This is very cool to see!
Small Minor Improvements
Lastly I made some extra improvements to the melody sequencer. So far all notes that were played in a sequence would have their key on for the full duration of a step, giving a legato effect. This often didn't sound right so I now allow to select the key on duration of the notes per sequence in 3 steps from staccato to legato.
Another annoyance that I managed to fix was due to the metronome. While live recording a melody by listening to the metronome beeps for timing I found that in the recording the notes always ended up on the previous step. I had already tried many fixes in the software before I realized that this was actually a human bug! The metronome would play a beep exactly at the start of a beat. This was causing the human to incorrectly time its key presses slightly before hearing the beep and the note being registered in the wrong step. Offsetting the metronome beep to sound just a few MIDI ticks after the start of the beat fixes the issue. Recording is now really smooth!