@libraz/libcantus - v1.1.0
    Preparing search index...

    Function tensionCurveFrom

    • Sample the tension of an arrangement already analysed by analyzeArrangement, reusing its harmony instead of inferring it again.

      analyzeArrangement followed by tensionCurve runs chord and key inference twice over the same notes. This takes the analysis it already produced, so the curve and the annotations describe the same harmony by construction.

      The analysis is the harmony to fall back on rather than one laid over the caller: key, keys and harmonyTracks each name a harmony the analysis does not hold, so naming one is asking for a different reading, and the curve is taken under it. Nothing else about the analysis is re-derived.

      Parameters

      Returns TensionPoint[]

      One TensionPoint per sampled beat, in beat order.

      import { analyzeArrangement, tensionCurveFrom } from '@libraz/libcantus';
      const tracks = [{ notes: [{ pitch: 60, startBeat: 0, durationBeat: 4 }] }];
      const analysis = analyzeArrangement(tracks);
      tensionCurveFrom(tracks, analysis, { step: 1 });