Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * Takes in values for MIDI notes and checks to make sure
- * they are valid (between 0 and 127). It will ask the user again for valid numbers.
- * If valid, this will return the note entered.
- */
- int acceptAndValidateInput(unsigned int which)
- {
- int note;
- while (1)
- {
- printf("Please enter MIDI note #%u (0-127): ", which);
- scanf("%d", ¬e);
- if (note < 0 && note > 127)
- printf("The value entered was invalid. Try again.\n");
- else
- return note;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement