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) {
|
if (pattern.faderParams[parameter] === -1 && target.staticValue !== undefined) {
|
||||||
return target.staticValue;
|
return target.staticValue;
|
||||||
}
|
}
|
||||||
return convertFaderValue(parameter, getStaticValue(pattern, parameter), track, groupMixer, target);
|
return convertFaderValue(
|
||||||
|
parameter,
|
||||||
|
getStaticValue(pattern, parameter),
|
||||||
|
track,
|
||||||
|
groupMixer,
|
||||||
|
target,
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
function getArrangementPoints(
|
function getArrangementPoints(
|
||||||
|
|||||||
@@ -130,9 +130,7 @@ function targetFor(parameter: any, maxValue?: number, soundLength?: number, inve
|
|||||||
soundLength,
|
soundLength,
|
||||||
invertValue,
|
invertValue,
|
||||||
staticValue:
|
staticValue:
|
||||||
parameter?.Manual?.['@Value'] === undefined
|
parameter?.Manual?.['@Value'] === undefined ? undefined : Number(parameter.Manual['@Value']),
|
||||||
? undefined
|
|
||||||
: Number(parameter.Manual['@Value']),
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -212,7 +210,8 @@ function trackAutomationTargets(midiTrack: any, includeArrangementMixer: boolean
|
|||||||
const sampleRef = samplePart.SampleRef;
|
const sampleRef = samplePart.SampleRef;
|
||||||
const sampleRate = Number(sampleRef.DefaultSampleRate?.['@Value']);
|
const sampleRate = Number(sampleRef.DefaultSampleRate?.['@Value']);
|
||||||
const sampleDuration = Number(sampleRef.DefaultDuration?.['@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 =
|
const soundLength =
|
||||||
sampleRate > 0
|
sampleRate > 0
|
||||||
? (trimmedFrames > 0 ? trimmedFrames : sampleDuration) / sampleRate
|
? (trimmedFrames > 0 ? trimmedFrames : sampleDuration) / sampleRate
|
||||||
|
|||||||
Reference in New Issue
Block a user