Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- #include <math.h>
- int main()
- {
- int note1,note2;
- double f,p;
- while (true) {
- printf("Please enter first MIDI note (0-127): ");
- scanf("%d", ¬e1);
- int valid = checkIfValid(note1);
- if (valid == 1)
- break;
- else
- printf("NO");
- }
- while (true) {
- printf("Please enter second MIDI note (0-127): ");
- scanf("%d", ¬e2);
- int valid = checkIfValid(note1);
- if (valid == 1)
- break;
- else
- printf("NO");
- }
- return 0;
- }
- int checkIfValid(int note) {
- if (note >= 0 && note <= 128)
- return 1;
- else
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement