Support

If you have a problem or need to report a bug please email : support@dsprobotics.com

There are 3 sections to this support area:

DOWNLOADS: access to product manuals, support files and drivers

HELP & INFORMATION: tutorials and example files for learning or finding pre-made modules for your projects

USER FORUMS: meet with other users and exchange ideas, you can also get help and assistance here

ADSR keytracking?

For general discussion related FlowStone

ADSR keytracking?

Postby Halon » Tue Sep 22, 2020 5:28 pm

Hi. Is there a way to implement proper keytracking for adsr envelopes? Have tried various ways with 'pitch to freq' and the likes but i doesnt sound right to me. Is there a simple code perhaps?

Cheers.
Halon
 
Posts: 300
Joined: Sat Nov 28, 2015 4:42 pm
Location: Norway

Re: ADSR keytracking?

Postby k brown » Tue Sep 22, 2020 11:03 pm

I'm sure Spogg will have something for you - I imagine the envelopes in Razorblade could be adapted to do this, for example; it has a great keytrack CV source as well.
k brown
 
Posts: 1014
Joined: Tue Aug 16, 2016 7:10 pm
Location: San Francisco, CA USA

Re: ADSR keytracking?

Postby Spogg » Wed Sep 23, 2020 7:48 am

Halon wrote:Hi. Is there a way to implement proper keytracking for adsr envelopes? Have tried various ways with 'pitch to freq' and the likes but i doesnt sound right to me. Is there a simple code perhaps?

Cheers.


What parameter(s) do you want to track?

In my case I modified Martin’s exponential envelope generator so the decay and release times got shorter for higher notes to simulate a piano’s behaviour. But creating a suitable transfer function between key number and time reduction was really quite tricky to get it sounding anything like right. For a piano the change of decay and release is dependent on wire length and tension and also to some extent on the number of strings per note over the key span. Also there’s no agreed standard for pianos so in the end it was a compromise based on listening and tweaking accordingly.
If you look inside my Quilcom SIM-PF you’ll see what I did for the envelopes, but keep in mind this may not be suitable for all situations.

viewtopic.php?f=3&t=37789&hilit=SIM#p112509

I hope this helps…
User avatar
Spogg
 
Posts: 2761
Joined: Thu Nov 20, 2014 4:24 pm
Location: Birmingham, England

Re: ADSR keytracking?

Postby tulamide » Wed Sep 23, 2020 8:03 am

I may have misunderstood, in which case I apologize. But it is much easier to work with normalized values instead of direct key number transfers.

MIDI protocol knows exactly 128 keys, and each incoming note carries its number in the midi message. Divide by 127 (indices are from 0 to 127) and you get a value between 0 and 1. Now you can multiply quite easily with either a fixed value, a formula or a table. And for reverse functionality just do 1 - x before the multiplication.
If you feel like gifting: https://paypal.me/tulamide
tulamide
 
Posts: 2432
Joined: Sat Jun 21, 2014 2:48 pm
Location: Germany

Re: ADSR keytracking?

Postby Spogg » Wed Sep 23, 2020 10:49 am

If I want to work with key ranges I find it easier to work with pitch/note values, then I work on those in a similar way. So for example for key range 36 to 60 I subtract 36 to give 24 then divide by 24 to give 0-1 for that key range.

What would be nice is a graphical method of creating a transfer curve. 0 to 1 in and 0 to 1 out. Maybe this exists but I don’t have it. Not that I’m hinting or anything... ;)
User avatar
Spogg
 
Posts: 2761
Joined: Thu Nov 20, 2014 4:24 pm
Location: Birmingham, England

Re: ADSR keytracking?

Postby DaveyBoy » Wed Sep 23, 2020 5:34 pm

Just a suggestion . . The Additive Osc prim outputs an array of 128 float values . . .which you can draw in yourself . . . also can be loaded with a saved array. Not it's intended purpose I know but looks to me like it could be re-purposed to do exactly what you want . . . just an idea! ;)
User avatar
DaveyBoy
 
Posts: 104
Joined: Wed May 11, 2016 9:18 pm
Location: Leeds UK

Re: ADSR keytracking?

Postby tulamide » Thu Sep 24, 2020 2:11 am

DaveyBoy wrote:Just a suggestion . . The Additive Osc prim outputs an array of 128 float values . . .which you can draw in yourself . . . also can be loaded with a saved array. Not it's intended purpose I know but looks to me like it could be re-purposed to do exactly what you want . . . just an idea! ;)

That's actually a cool idea. Just check if it's the 0-1 range per bin.
If you feel like gifting: https://paypal.me/tulamide
tulamide
 
Posts: 2432
Joined: Sat Jun 21, 2014 2:48 pm
Location: Germany

Re: ADSR keytracking?

Postby tulamide » Thu Sep 24, 2020 2:13 am

Spogg wrote:What would be nice is a graphical method of creating a transfer curve. 0 to 1 in and 0 to 1 out. Maybe this exists but I don’t have it. Not that I’m hinting or anything... ;)

Yep, I took a big bite, and now I'm hooked. Oh my...
If you feel like gifting: https://paypal.me/tulamide
tulamide
 
Posts: 2432
Joined: Sat Jun 21, 2014 2:48 pm
Location: Germany

Re: ADSR keytracking?

Postby DaveyBoy » Thu Sep 24, 2020 3:29 am

tulamide wrote:Just check if it's the 0-1 range


Yes it is . . I'm thinking you could draw in the curve of the cast iron piano frame . . . . . or maybe I'm getting carried away here :lol:
User avatar
DaveyBoy
 
Posts: 104
Joined: Wed May 11, 2016 9:18 pm
Location: Leeds UK

Re: ADSR keytracking?

Postby Spogg » Thu Sep 24, 2020 8:13 am

Guys, since posting my “wish” I realised that the transfer function really needs to operate at stream rates in order to control stream parameters like decay time.

If we had a graphically created float array it could be put into a mem reader where the reader's index was created by multiplying 0-1 by the array size, say 512. The output stream would then be a value based on the 0-1 value indexed by the 0-512. I think that’s what Davey was thinking.

One bonus of such a system is it could describe a distortion transfer curve, wave folding or even a compressor’s response curve. For this it would need to be quite high resolution to reduce quantisation noise, but for decay times it could be much lower resolution.

I know what I mean anyway. :lol:
User avatar
Spogg
 
Posts: 2761
Joined: Thu Nov 20, 2014 4:24 pm
Location: Birmingham, England

Next

Return to General

Who is online

Users browsing this forum: No registered users and 14 guests