Elektrine lite

← Feed

@murks@social.tchncs.de

Post #2411782

2021-11-25 20:32 UTC

@sjaehn@fosstodon.org Thanks :] Part of my problem is that I didn't understand what ADSR was supposed to do. Sure we knew the method signature, but not the purpose. And what does Key::get() get? It was not obvious to me what these methods were supposed to do. I showed the plugin and code on stream today and tried to understand where an issue comes from. There I noticed that I didn't even know where the Key objects come from or how many there are. Maybe it's just my lack of C++ knowledge, not sure.

Replies (3)

  • @sjaehn@fosstodon.org 2021-11-26 11:56

    @murks@social.tchncs.de OK, I didn't explain the purpose of ADSR. Maybe I'm too focused on electronic musicians who want to start programming. For them the purpose was clear before. ADSR envelopes are put on top for each key. To softly fade in (A_ttack), softly go down (D_ecay) to a S_ustain level, and softly fade out (R_elease). Othewise you would only have on (1) or off (0). This would produce very nasty clicks. adsr() simply returns the level of the envelope function for the actual time when a key is on.

    Open ##2411783

  • @sjaehn@fosstodon.org 2021-11-26 12:00

    @murks@social.tchncs.de OK, Key::get() is not the most intuitive name. Maybe play or synth would be better. But I used or will use these symbols differently. Key::get() simply synthesizes an audio signal from the sine wave, the MIDI velocity, and the ADSR envelope.

    Open ##2411800

  • @sjaehn@fosstodon.org 2021-11-26 12:08

    @murks@social.tchncs.de Defining the class Key is clear. But this doesn't create an object. Right. This was your point. The object is declared in the video at 2:20 as a member of MySineSynth. And its only one object. So the synth we made is a Monosynth. The object key starts its life at 2:28 in the initializer of MySineSynth.

    Open ##2411802