X-Git-Url: https://git.notmuchmail.org/git?a=blobdiff_plain;f=scherzo-key.h;fp=scherzo-key.h;h=07cdd702ce0864785cddb864125429c37338983f;hb=45d36bd8372f38186ceebf74b48f1a67bd67c573;hp=0000000000000000000000000000000000000000;hpb=b588ae80ff8009695f7ed299fd27e3f16de01e9e;p=scherzo diff --git a/scherzo-key.h b/scherzo-key.h new file mode 100644 index 0000000..07cdd70 --- /dev/null +++ b/scherzo-key.h @@ -0,0 +1,44 @@ +/* scherzo - Music notation training + * + * key.h - Common structures and functions for keys + * + * Copyright © 2013 Carl Worth + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see http://www.gnu.org/licenses/ . + */ + +#include + +#ifndef SCHERZO_KEY_H +#define SCHERZO_KEY_H + +#include "pitch.h" + +typedef struct scherzo_key +{ + /* Pitch class (diatonic) */ + pitch_t pitch; + + /* Number of sharps/flats in key (if any) */ + int num_sharps; + int num_flats; +} scherzo_key_t; + +void +scherzo_key_init (scherzo_key_t *key, pitch_t pitch); + +bool +scherzo_key_contains_pitch (scherzo_key_t *key, pitch_t pitch); + +#endif /* KEY_H */