@libraz/libcantus - v0.9.3
    Preparing search index...

    Function generateBassLine

    • Generate a bass line following a chord placement.

      Each segment contributes notes in the chosen bass register per the selected style; consecutive notes are kept within roughly a fifth. Every note's duration extends to the next onset (the final note extends to the last segment's end). Given a seed the output is fully reproducible.

      Parameters

      Returns NoteEvent[]

      Bass notes sorted by onset, non-overlapping.

      import { generateBassLine, makeChord, majorKey } from '@libraz/libcantus';
      const segments = [
      { startBeat: 0, endBeat: 4, chord: makeChord(0, 'maj') },
      { startBeat: 4, endBeat: 8, chord: makeChord(7, 'maj') },
      ];
      const notes = generateBassLine({ segments, key: majorKey(0), style: 'walking' });