def TrajectoryLookBefore(listOfChords, Tonnetz, origin=(0, 0)): """The call for recursive trajectory.""" trajectory = TrajectoryClass( ChordConfiguration( listOfChords[0], origin, Tonnetz), listOfChords, Tonnetz) for index, chord in enumerate(listOfChords): if index == 0: continue elif index == 1: thisChordCoord, connectingEdge = applyFirstSuccessful([ lambda: computeChordCoord(trajectory.getThisChord(), trajectory.getLastPosition(), trajectory.Tonnetz), lambda: placeChordWithVirtualRef(trajectory.getThisChord(), trajectory.getLastPosition(), trajectory.getNextChord(), trajectory.Tonnetz) ]) else: thisChordCoord, connectingEdge = trajectoryRecursive(trajectory) trajectory.addChord(thisChordCoord, connectingEdge) return trajectory
def NewTrajectory(listOfChords, Tonnetz, origin=(0, 0)): """The Call function for trajectory with future Calculations.""" trajectory = TrajectoryClass( ChordConfiguration( listOfChords[0], origin, Tonnetz), listOfChords, Tonnetz) for index, chord in enumerate(listOfChords): if index == 0: continue elif index == 1: thisChordCoord, connectingEdge = applyFirstSuccessful([ lambda: computeChordCoord( trajectory.getThisChord(), trajectory.getLastPosition(), trajectory.Tonnetz), lambda: placeChordWithVirtualRef( trajectory.getThisChord(), trajectory.getLastPosition(), trajectory.getNextChord(), trajectory.Tonnetz) ]) else: thisChordCoord, connectingEdge = TrajectoryWithFuture(trajectory) trajectory.addChord(thisChordCoord, connectingEdge) return trajectory
def TrajectoryNoFuture(listOfChords, Tonnetz, origin=(0, 0)): """The Call Function of this version of the trajectory.""" trajectory = TrajectoryClass( ChordConfiguration(listOfChords[0], origin, Tonnetz), listOfChords, Tonnetz) for index, chord in enumerate(listOfChords): if index == 0: continue else: thisChordCoord, connectingEdge = applyFirstSuccessful([ lambda: trajectoryRecursive(trajectory), lambda: lastResort(trajectory) ]) trajectory.addChord(thisChordCoord, connectingEdge) return trajectory