Discussion:
getting time/x-value from an env at a given level/y-value?
Michael Zacherl
2014-10-15 15:15:58 UTC
Permalink
Hi, I ran into a problem where I need to adapt old presets to a new parameter structure.
Which appears to be a pain … alas.
Point is I'm using envelopes as translation curves for MIDI-CC values.
So I need to get a new value I need the time/x-value of an existing envelope to
take this to the new envelope and get the respective level/y-value.
Old presets loaded into the new structure tend to 'explode', i.e. get very loud.
It's not just about volume, it's several parameters related to one MIDI-CC.
Is there a way to solve this?
Thanks, Michael.

--
http://mz.klingt.org




_______________________________________________
sc-users mailing list

info (subscription, etc.): http://www.beast.bham.ac.uk/research/sc_mailing_lists.shtml
archive: http://www.listarc.bham.ac.uk/marchives/sc-users/
search: http://www.listarc.bham.ac.uk/lists/sc-users/search/
felix
2014-10-15 17:04:31 UTC
Permalink
there may, and most probably will be more than one x for an Envelope's y

look at Array asArrayForInterpolation

you can use that table to search for the first x that aprox equals y
Post by Michael Zacherl
Hi, I ran into a problem where I need to adapt old presets to a new parameter structure.
Which appears to be a pain 
 alas.
Point is I'm using envelopes as translation curves for MIDI-CC values.
So I need to get a new value I need the time/x-value of an existing envelope to
take this to the new envelope and get the respective level/y-value.
Old presets loaded into the new structure tend to 'explode', i.e. get very loud.
It's not just about volume, it's several parameters related to one MIDI-CC.
Is there a way to solve this?
Thanks, Michael.
--
http://mz.klingt.org
_______________________________________________
sc-users mailing list
http://www.beast.bham.ac.uk/research/sc_mailing_lists.shtml
archive: http://www.listarc.bham.ac.uk/marchives/sc-users/
search: http://www.listarc.bham.ac.uk/lists/sc-users/search/
--
..
http://soundcloud.com/crucialfelix
http://github.com/crucialfelix
.
James Harkins
2014-10-15 23:23:22 UTC
Permalink
Post by felix
there may, and most probably will be more than one x for an Envelope's y
look at Array asArrayForInterpolation
you can use that table to search for the first x that aprox equals y
Perhaps more straightforward is array = myEnv.discretize(arraySize). Then
you can use array.indexInBetween(value) for the first match, then scale it
to the envelope length.

array.indexInBetween(value) / array.size * env.duration

Untested.

hjh

Sent with AquaMail for Android
http://www.aqua-mail.com





_______________________________________________
sc-users mailing list

info (subscription, etc.): http://www.beast.bham.ac.uk/research/sc_mailing_lists.shtml
archive: http://www.listarc.bham.ac.uk/marchives/sc-users/
search: http://www.listarc.bham.ac.uk/lists/sc-users/search/

Loading...