jameshball / osci-render-juce

〰📺🔊 Synthesizer for making music by drawing objects on an oscilloscope using audio. Now as an audio plugin!
GNU General Public License v3.0
8 stars 0 forks source link

Add intuitive way of controlling MIDI settings like attack/decay/etc. #18

Closed jameshball closed 8 months ago

jameshball commented 1 year ago

We obviously depend on #8 before we can implement this.

Something like this would be amazing:

Image

Can download here to reverse-engineer / for a case study https://vital.audio/ and it's also open source: https://github.com/mtytel/vital

This explains what an envelope is and what all the parameters do: https://en.wikipedia.org/wiki/Envelope_(music)#ADSR

To see roughly how you'd implement a basic version of this, take a look at the volume visualiser component: https://github.com/jameshball/osci-render-juce/blob/9293214943af555d2aaa15eb4f71dc3771a66a9d/Source/components/VolumeComponent.cpp

This has a paint() function that you draw the component for. We could quite easily draw a JUCE Path that goes between the attack/decay/release/sustain etc. points. The harder part would be supporting dragging the points around which I don't immediately know how to do, but the JUCE Slider class will give some ideas. The DragAndDropContainer also looks very promising - we could have the knobs as separate components that are DragAndDropContainers and have the parent ADSR component be the DragAndDropTarget that has callbacks for when the knob is being dragged and can update values accordingly.

jameshball commented 10 months ago

Image

Basic version of ADSR envelope component implemented

Still TODO:

jameshball commented 8 months ago

It is now functional, automatable, and looks good:

Image