Superseded: Bees-in-the-Trees 3.z: the post-antepenultimate v3 release candidate


#1

Latest version: 3.9 - please see this post The information below, in this post, is of historical interest only. Full documentation and links to source code and compiled audio bootloader firmware update WAV files for Bees-in-the-Trees are here.


With thanks to @Sneak-Thief and soundwave106 (on MW) for inspiring me to finally start hacking the Braids source code, I am pleased to announce Bees-in-Trees version 1. This is a beta (test) version of enhanced Braids v1.6 firmware code. If you are brave or foolhardy, feel free to test it on your Braids (details and warnings below). I would be very grateful for any feedback, further suggestions and bug reports. I have tested most of the new and existing functions in it, and everything seems to work.

Bees-in-Trees v1 adds the following features to Braids v1.6:

  • Square-sawtooth-triangle triple oscillator model: this works identically to the existing triple sawtooth and triple square oscillator models, except that instead of sawtooth or square waveforms for each paraphonic voice, it uses one square, one sawtooth and one triangle waveform. The result is appreciably different from the existing triple waveform models.
  • Triple triangle oscillator model (^^x3): this works identically to the existing triple sawtooth and triple square oscillator models, except that it uses a triangle waveform for all three oscillators. Due to the much less bright harmonics in a triangle wave, it can be used effectively without any filtering, if desired.
  • Triple sine wave oscillator model (SINS): this works identically to the existing triple sawtooth and triple square oscillator models, except that it uses a sine waveform for all three oscillators. Due to the absent harmonics in a sine wave, it can be used effectively without any filtering, if desired, although there are some harmonics because all three waves are summed - nonetheless, it sounds very smooth and rounded, sans filtering, as you might expect.
  • WTx2 duophonic wavetable model with second voice offset controlled by the Color parameter: this model is the love-child of the existing triple waveform models and the existing WTx4 model. Unlike the WTx4 model, it has only two paraphonic “voices”, not four, and the pitch of the second voice is offset from the first voice by an amount set by the Color parameter (both Color potentiometer and Color CV input), in the same way that the Color parameter controls the third voice in the triple oscillator models. Timbre scans the same wavetable in the same manner as it does in the WTx4 model. However, each of the two “voices” consists of two wavetable oscillator instances, each detuned from each other by a small amount. The degree of detune is different for each pair of oscillators, and also varies as the Color parameter changes. The result is a thick chorus effect on both “voices”, an effect which varies as the Color parameter is swept.
  • Color is now also a target for the internal envelope: the available choices under the TDST menu are now: SYNC, TIMB, LEVL, T+L, COLR, T+C, L+C, ALL. The compound destinations are self-explanatory. The ability to modulate Color with the internal envelope significantly enhances some of the oscillator models, in others, not so much, and in a few, it is useless, but not harmful.
  • Voltage control over the attack and decay of the internal envelope, via the FM input (and fine tune knob), as in the existing META mode: instead of offering just ON or OFF, the META menu now offers the following choices: OFF , MODL, ATTK, DCAY, AD.1, AD.2, AD.3, AD.4, AD.5, AD.6, AD.7, AD.8, AD.9, A=D, DA.9, DA.8, DA.7, DA.6, DA.5, DA.4, DA.3, DA.2, DA.1. MODL is identical to the existing META=ON mode. ATTK and DCAY use the voltage on the FM input (plus the fine tune knob setting) to override the attack and decay parameters, respectively, of whatever envelope is currently selected in the TENV menu. In other words, in ATTK mode, the envelope attack time is voltage-controlled via the FM input, but the decay time honours the decay time for whatever fixed envelope type is selected in TENV. Vice-versa for DCAY mode. The remaining new META modes, AD.1 through to DA.1, put both attack time and decay time of the internal envelope under voltage control via the FM input (and fine tune knob). The numbers refer to the ratio of attack to decay time e.g. for AD.1 mode, the ratio of attack time to decay time is 0.1, while for AD.8, the ratio is 0.8. By extension, DA.6 means the ratio of decay time to attack time is 0.6, which is the same as the ratio of the attack to decay time being 1.66. A=D mode means the attack time equals the decay time. However, although the ratios are fixed for each mode, the actual times are not - they are under voltage control via the FM input. Why did I do it this way? Because it was easiest to code, and requires no change to the format of the data saved on the MPU.

Plus an anti-feature:

  • A paschal oophorectomy has been performed: the Easter egg oscillator model has been removed and the ability to trigger Easter egg mode has been disabled. One could say that the code for it has been Pynchoned off… This was necessary to free up space for the enhancements described above. Sorry!

This release of Bees-in-Trees is still decidedly beta. I have done some testing, and have not encountered any problems or bugs, but more testing is required, and I would be grateful for any assistance in that regard. There are also some aspects that need further tweaking and optimisation: the linearity of the envelope ratios needs to be adjusted.

The source code for all these enhancements is available on GitHub. If you are really keen, then please compile it, flash it to your Braids and try it out. There is also a WAV version of the Bees-in-Trees v1 binary available (superseded). If you are really, really keen, you can download it (DON’T listen to it) and use it to load the Bees-in-Trees firmware into your Braids via the upgrade procedure described in the Braids manual. However, you do so at your own risk - this a a beta version of hacked code! Although it is will not physically damage your Braids, it could possibly render it non-functional, and I am afraid that I cannot offer any assistance beyond posts to this forum, should that occur. I have tested upgrading from Bees-in-Trees v1 to Braids v1.7 via the WAV audio upgrade mechanism, and it works, but you need to ensure that you have set META to OFF and TDST to SYNC and then save those parameters by exiting menu mode, before you attempt to replace the Bees-in-Trees firmware with Braids v1.7. This is because Bees-in-Trees uses additional values in those settings, and if you have those additional values stored when you happen to change to Braids v1.7, then META mode may not operate, at least at first. I found that resetting the values by exiting the menu and going back, twice, after upgrading to Braids v1.7, fixed the issue. None of these concerns apply if you are loading firmware via the FTDI serial or JTAG/SWD OCD interfaces on Braids, because they completely overwrite everything on the chip AFAIK. Anyway, YOU HAVE BEEN WARNED! If in doubt, don’t load the Bees-in-Trees v1 firmware via the audio upgrade mechanism. I’ll do further testing of the upgrade/downgrade issues after porting the Bees-in-Trees changes to Braids v1.7 code, when available. As an aside, Braids would benefit from a menu option that re-initialises all stored data - such a menu option would overcome issues such as these.


#2

Hmmm, just noticed that these hacks seem to have inadvertently disabled auto-trigger mode - must investigate…

Edit: nope, ignore that, it continues to working perfectly.


#3

1. The new Meta AD-modes all function as described :slight_smile:

2. Your triple-sine mode is distorting just like when I first tried it. In your previous Macon version, it wasn’t. There’s always the code soundwave106 posted:

sample += static_cast<int32_t>(voice_1_buffer[i >> 1]) * 4 >> (shape_MACRO_OSC_SHAPE_TRIPLE_SINE?4:3);
sample += static_cast<int32_t>(voice_2_buffer[i >> 1]) * 5 >> (shape_MACRO_OSC_SHAPE_TRIPLE_SINE?4:3);
sample += static_cast<int32_t>(voice_3_buffer[i >> 1]) * 5 >> (shape_==MACRO_OSC_SHAPE_TRIPLE_SINE?4:3);


#4

Hmmm, I’m pretty sure the code for triple-sines is identical in both versions, but I’ll check (isn’t git wonderful!). I’ll also have another look at the output on the oscilloscope.


#5

Here a quick demo of voltage-control of the internal envelope and the color-as-additional-envelope-destination modifications:

https://www.youtube.com/watch?v=tXqf6QrNKnU


#6

Problem solved:

“Hmmm, I’m pretty sure the code for triple-sines is identical in both versions, but I’ll check (isn’t git wonderful!). I’ll also have another look at the output on the oscilloscope.”

This is what I suspected. I noticed in your original code that you hadn’t reduced the triple-sine levels but it wasn’t distorting - which confused me because in my attempt I needed to drop it to prevent distortion.

So, I decided to erase the entire memory and load everything again including the bootloader and the sine distortion magically disappeared.


#7

OK, thanks. Yes, to solve the clipping problem, I added this code, which halves the amplitude of the sine waves, but not the other triple waveforms.


#8

I’ve added triple sine and triangle in the official firmware. This is a different implementation though, that does not piggyback on the existing square/saw code (which runs at half the sample rate, an unnecessary “feature” for the simpler sine and triangle code).

The other synthesis models are a bit too specialized for inclusion in the official firmware.

As for the additional envelope functionalities, they are well beyond the scope of the module. In the official firmware, the accessory envelope will remain an accessory :slight_smile:


#9

Ah yes, I did notice that the saw and square waves use BLEPs at half the sample rate, but triangle and sine don’t, but out of expedience, as opposed to experience, I just re-used the same code anyway. It is great that the triple triangle and triple sine will be in the official firmware - they both sound really nice. I was dubious about the triple sines being worthwhile at first, but now I am hooked - they sound quite spooky and ethereal, and at low frequencies, vaguely menancing.

I’m a bit diffident about the other two additional oscillator models which I added. The square-saw-triangle triple doesn’t sound remarkably different from the triple square. The WTx2 model needs more work. I noticed some clicks when it is used with the internal envelope, both when externally and auto-triggered. These clicks are also present to a lesser extent in the WTx4 model, even in the unmodified official firmware. It does not click on every note played, just every third or fourth note, non-deterministically. Could it be the sync being disabled when the envelope is used for level modulation? But I can’t hear it in any other wavetable model. Hmmm.

I am definitely going to keep the color as additional envelope target and voltage-controlled envelope parameter features in Bees-in-Trees, though, although I understand why they might be a step too far for the official firmware.

Finally, is that any chance you could add a “re-initialise” function to the menu, which resets all stored settings to the initial template. Having that may avoid grief when swapping between official and hacked versions of the firmware, since the latter may modify what data is stored and its layout. Alternatively, the settings Init method could be invoked by the audio bootloader, could it not? That would mean all settings are lost after every firmware upgrade, but there aren’t many settings and they are easily reset in about 30 seconds.


#10

I will investigate on the clicks.

I will also try to find a secret handshake to reinitialize the settings.


#11

Fab! A reinitialise settings procedure would be great.

Could the clicks relate to randomly setting the phase at each trigger strike? It may only be noticeable when more than more wavetable is almost in unison? Just grasping at straws, due to the non-deterministic nature of the clicks.


#12

> Could the clicks relate to randomly setting the phase at each trigger strike?

Indeed. I don’t think I will do anything… I like this phase randomization feature.


#13

Yes, I agree, it would be a shame to remove it from WTx4. I’ll experimwnt with its removal from my WTx2 model to see what is lost.


#14

@pichenettes, any thoughts on a secret handshake to re-initialise Braids settings after a firmware change?


#15

Yep, it’s now implemented. You go to the end of the menu (displaying the version number) and hold the encoder for 1s.


#16

LET THE MAN ENJOY HIS VACATION FOR THE LOVE OF #%$&!


#17

Damn. Too late.


#18

@pichenettes, fab! Many thanks, that will save a lot of grief in the future.


#19

@t2k: I agree.

http://uploads.neatorama.com/images/posts/774/68/68774/1390354899-0.jpg


#20

t2k andaudiohoarder, sorry, I assumed that Olivier treated this forum as an asynchronous communications channel, rather than a near real-time synchronous channel. In other words, if he were on holidays and didn’t wish to be disturbed by forum posts, then he wouldn’t look at the forum until his holidays were over. Substitute email, Facebook posts, tweets etc for forum posts and the same applies. Only voice telephone calls and face-to-face contact tend to be synchronous, and even then one can turn the phone off or travel to a remote holiday destination to avoid the clamouring hoards of Mutable fans.