convertNoteToMidi is a useful C library that converts any single musical note value and octave to a midi note. I created it to create a simple means to integrate string-based musical notes in my C based musical projects. This library could be useful for anyone needing to type note values like C#, Bb, or D into your C programs and need to get a precise midi note.
char *note = "G#";
int octave = -2;
int test = convertNoteToMidi(note, octave);
printf("The midi value of %s at octave %i is: %i\n", note, octave, test);The midi value of G# at octave -2 is: 8
- Download this repo to your local drive.
- Open a terminal.
- Navigate in your terminal to the folder containing this repo.
- First, run
make convertNoteToMidi. - Second, execute
./main. Oogle at the output. - Third, open main.c and modify the
noteandoctaveto your liking. - Fourth, run
make convertNoteToMidiagain. - Fifth, execute
./mainagain and see the output. - Finally, modify
main.cfor your use. Make sure you look at the text of theMakefileso you understand how to bring in external libraries into your own C program.
Your contributions to this project are very much appreciated. If you would like to help make this project better, fork to repo and create a pull request. Alternatively, you can open an issue with the tag "request." Please star this project!
- Fork the Project and make a branch with your feature (
git checkout -b feature/myFeature). - Commit your Changes (
git commit -m 'Added myFeature'). - Push to the Branch (
git push origin feature/myFeature). - Open a Pull Request.
Distributed under the MIT License. See LICENSE.txt for more information.