Format and clean up parameter value extraction in Ableton exporters
This commit is contained in:
@@ -130,7 +130,13 @@ function getConvertedStaticValue(
|
||||
if (pattern.faderParams[parameter] === -1 && target.staticValue !== undefined) {
|
||||
return target.staticValue;
|
||||
}
|
||||
return convertFaderValue(parameter, getStaticValue(pattern, parameter), track, groupMixer, target);
|
||||
return convertFaderValue(
|
||||
parameter,
|
||||
getStaticValue(pattern, parameter),
|
||||
track,
|
||||
groupMixer,
|
||||
target,
|
||||
);
|
||||
}
|
||||
|
||||
function getArrangementPoints(
|
||||
|
||||
@@ -130,9 +130,7 @@ function targetFor(parameter: any, maxValue?: number, soundLength?: number, inve
|
||||
soundLength,
|
||||
invertValue,
|
||||
staticValue:
|
||||
parameter?.Manual?.['@Value'] === undefined
|
||||
? undefined
|
||||
: Number(parameter.Manual['@Value']),
|
||||
parameter?.Manual?.['@Value'] === undefined ? undefined : Number(parameter.Manual['@Value']),
|
||||
};
|
||||
}
|
||||
|
||||
@@ -212,7 +210,8 @@ function trackAutomationTargets(midiTrack: any, includeArrangementMixer: boolean
|
||||
const sampleRef = samplePart.SampleRef;
|
||||
const sampleRate = Number(sampleRef.DefaultSampleRate?.['@Value']);
|
||||
const sampleDuration = Number(sampleRef.DefaultDuration?.['@Value']);
|
||||
const trimmedFrames = Number(samplePart.SampleEnd['@Value']) - Number(samplePart.SampleStart['@Value']);
|
||||
const trimmedFrames =
|
||||
Number(samplePart.SampleEnd['@Value']) - Number(samplePart.SampleStart['@Value']);
|
||||
const soundLength =
|
||||
sampleRate > 0
|
||||
? (trimmedFrames > 0 ? trimmedFrames : sampleDuration) / sampleRate
|
||||
|
||||
Reference in New Issue
Block a user