An evaluation function for the Lambda Feedback platform. It compares a student's music performance against a reference performance and returns formative feedback on pitch accuracy, timing, note duration and chords.
The student's response and the reference answer can each be MIDI note data, or the path to an audio recording, which is transcribed to MIDI before the comparison.
- docs/user.md — for teachers setting up a question: input format, what the student sees, and the parameters that control strictness.
- docs/dev.md — inputs, outputs and worked examples.
Both files are published to the Lambda Feedback documentation site.
evaluation_function/
compare_MIDI.py # alignment, scoring and feedback generation
audio_processing.py # audio-to-MIDI transcription (Basic Pitch)
evaluation.py # platform entry point, thin wrapper
preview.py # preview entry point
main.py # server entry point
*_test.py # tests
data/ # fixtures used by the tests
docs/ # user and developer documentation
notebooks/ # development and evaluation notebooks, see notebooks/README.md
config.json # evaluation function name used when deployingpoetry install
poetry run pytestTo run the function in a container:
docker build -t compare-music .
docker run --rm -p 9000:8080 compare-musicIt then answers POST http://localhost:9000/ with a command: eval header and a body of {"response": ..., "answer": ..., "params": {}}. GET /health reports readiness.