tie decodeNote into the learning algorithm