Troubleshooting

This section details some of the common issues you may encounter while building this project and steps you can use to resolve them.

Notes are missed

The most common cause of missed notes is the delay between the note on event and note off event in the MIDI file. If the MIDI file is too short, it will not give the servo arm time to extend and retract. This can be rectified using the midi_note_expand.py script included in the code for this chapter.

This script can be run using the following command; here, MIDI_FILE is the filename of the MIDI file, DELAY is the desired minimum delay in milliseconds between note on and note off events, and TEMPO is the tempo you intend to play the file at (the delay time will vary depending on the tempo at which the file is played):

python midi_note_expand.py -f MIDI_FILE.mid -d DELAY -t TEMPO

This script will produce an output similar to that shown in the following screenshot. By default, it saves the modified file as MIDI_FILE_modified.mid. By default, the script will only modify the delay between the notes if it is less than the value set using the -d parameter. The script can also be used to set the delay between note events for all the notes in the file to the same value by adding the -s flag to the end of the command.

Notes are missed

Servos do not move correctly

If the servos seem to be behaving erratically, then there is almost certainly an issue regarding a lack of sufficient power supply for all the servos. This can be confirmed by measuring the voltage across 5 V and ground connections on the servo power distribution board.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.227.46.69