Peaks source code released

Have fun!

1 Like

Ok, the 808 BD model us indeed cool.

Long-awaiting release, very good news!

@schrab: can we expect to see a DIY version using a hand-etched PCB?

@BennelongBicyclist: I’m going to make a couple of Peaks, but have not much spare time at the moment.

Is there any way to add new 808 or drum modules, like a clap, shaker or open hi hat?
I have 2 peaks :slight_smile:

Technically feasible, but certainly not my priority.

Well that’s good to know, and yes with all your work on the new modules I bet it’s not a priority, but hopefully one day it will be :slight_smile:

Is this a good place to talk about feature-requests?

I imagine one additional envelope mode: an attack-hold-release or attack-sustain-release (AHR, ASR) mode with “depth” (amplitude) control, like the tap-LFO mode. Not having to “waste” space/cables on attenuators is always nice.

Actually, I don’t even really care about the “hold” or “sustain” stage, I’d just like to have control over envelope depth, an attack stage, and a decay stage. Maybe the other parameter could be “attack/decay curve.” Center value: linear attack/decay. To the left: expo attack/linear decay. To the right: linear attack, expo decay. Or something like that. I think I’m getting into feature-creep with my own imaginary feature-request!

I’m no programmer, but I can understand what’s going on in code, usually. Oliver, if you don’t have the time to look into this, how do you recommend one would proceed (with the more simple request of adding amplitude control over an A/D envelope)?

> Oliver, if you don’t have the time to look into this,

It’s not a matter of time, but Peaks is already too crowded with modes! I don’t want to make the UI even more cryptic… People already have trouble remembering what the knobs do (even I forget what the pulse repeater/randomizer modes do…).

You could start by hacking the existing ADSR envelope…

This is where the ADSR envelope receives the values from the knobs (between 0 and 65535).

You can hack set_ar with a third argument indicating the hold level. Stuff this value into level_[1] (the possible range is 0 to 32767, so the value read from the pot will have to be >>1). There are plenty of examples of other envelope modes…

To get a shape between linear and exponential, that will be a bit more complicated… This is where we do the table lookup to get the envelope curve. You would need to do a lookup in both the linear table and in the expo table… and crossfade between them.

uint16_t t_lin = Interpolate824(lookup_table_table[LUT_ENV_LINEAR], phase_);
uint16_t t_exp = Interpolate824(lookup_table_table[LUT_ENV_EXPO], phase_);
uint16_t t = t_lin + ((t_exp - t_lin) * shape_ >> 16);

Once you get that working, it’s probably easier to create a copy of the MultistageEnvelope class with all your changes and call it MyEnvelope or something…

Then you need to register it among the available trigger processors:

Finally, the mapping between UI modes, channels 1/2 and the actual class that will do the job is done here

The first four lines are the normal functions, the next four lines the “bonus” functions. The first column what channel 1 does, the second column what channel 2 does (which means that yes, you can create bastard modes…)

Yeah, Peaks is mode-heavy, but that’s cool with me! The more value, the better (and I got a B-stock one!) I have a little cheat-sheet, until I remember all the pertinent modes.

Generally, I just have one side doing an envelope and the other channel spitting out and LFO.

I’ll see what I can do with this information. I’m at about 50% of understanding.
Ideally, I’d replace the number-station mode with the “AD envelope with depth control mode,” despite the fact that could listen to it for hours.

Remember, I still have donationware cheat cards for Peaks available! :slight_smile: