Command line interface

Command line interface for Jird.

Primary functions

interactive_mode_repl(transform, play)[source]

REPL (Read-Eval-Play Loop) for interactively playing music.

Parameters:
  • transform (callable Piece -> Piece) – Function to apply to music before playing. Allows tempering music for example.

  • play (callable Piece -> None) – Function to play music with.

ear_training(training_input, transform, play)[source]

Ear training mode.

Play intervals randomly selected from training_input and ask user to input the corresponding ratio. Print correct ratio if answer is wrong.

Parameters:
  • training_input (list of str) – List of ratios to choose from for ear training. Expected to be just the ratios, e.g. “7/6” rather than “<1 7/6>:1”.

  • transform (callable Piece -> Piece) – Function to apply to music before playing.

  • play (callable Piece -> None) – Function to play music with.

top_level(args)[source]

Top level function for running command line interface.

Uses same transform and play functions in all modes, so e.g. tempering music automatically works in interactive, ear training, and file playback modes.

Parameters:

args (Namespace) – Command line arguments.