bach: interpret "exponential" dynamics

Discussions, advice, bug reports and much more about the "bach" environment.
Post Reply
sydy
Posts: 156
Joined: Tue Mar 21, 2017 1:34 pm

bach: interpret "exponential" dynamics

Post by sydy » Sat Aug 06, 2022 8:36 am

Hy,

Do you have a formula or a specific way to interpret exponential dynamics? I'm just working on a conversion of the dynamic information attached to breakpoints (breakpointshavevelocity 1) and I'm wondering about a good way to interpret exponential dynamic in term of time-dynamic relation.
Here's an eg.
How would you handle the "exponential" dynamic change between breakpoint 1 and breakpoint 2?
[ [ auto 0 0. ] f > ] [ [ breakpoint 1 0.3 ] p << ] [ [ breakpoint 2 0.6 ] ff _ ] [ [ breakpoint 3 0.8 ] [ ] > ] [ [ auto 0 1. ] ppp = ]

Here's the full note for try out...

Code: Select all

note 1 1
	[ 191.428571
		[ 7000.000000 2419.000000 93
			[ breakpoints
				[ 0.000000 0.000000 0.000000 93 ]
				[ 0.300000 800.000000 0.000000 103 ]
				[ 0.600000 -1000.000000 0.000000 103 ]
				[ 0.800000 1100.000000 0.000000 103 ]
				[ 1.000000 0.000000 0.000000 1 ]
			]
			[ slots
				[ 20
					[
						[ auto 0 0.000000 ]
					f > ]
					[
						[ breakpoint 1 0.300000 ]
					p << ]
					[
						[ breakpoint 2 0.600000 ]
					ff _ ]
					[
						[ breakpoint 3 0.800000 ]
						[ ]
					> ]
					[
						[ auto 0 1.000000 ]
					ppp = ]
				]
			]
		0 ]
	0 ]

danieleghisi
Site Admin
Posts: 1349
Joined: Fri Dec 03, 2010 1:25 pm

Re: bach: interpret "exponential" dynamics

Post by danieleghisi » Sun Aug 07, 2022 10:44 am

Hello, there's no specific way you should interpret exponential crescendi, it's a bit up to you.
The only portion of code in which we implement something that needs it to be formalized is while calling dynamics2velocities: there, we use a curvature of 0.6 between the dynamic-to-velocities mappings. Bear in mind that bach's default curve equation is

// Curve function is
// y = t^((1+slope)/(1-slope))
// for positive slopes and
// y = 1-(1-t)^((1-slope)/(1+slope))
// for negative slopes.
// The parameter t is the normalized x (between 0 and 1), and result is also normalized between 0 and 1

This differs from Max's one for good reasons: see #curve in the help center, for instance. You can however choose to use Max's one by changing the @slopemapping attribute

Best,
Daniele

Post Reply