aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavide Morelli <morellid@users.sourceforge.net>2006-01-21 00:11:05 +0000
committerDavide Morelli <morellid@users.sourceforge.net>2006-01-21 00:11:05 +0000
commit33c37365934be52da44e8b70f6282a1bdf4b64ce (patch)
tree57a6c4eb6cbed12974941797be55274a6e372852
parent10a3fd828512907e52f3eabdd7c69b3eaa98757f (diff)
all msvc project files centralized in frankenstein.sln
svn path=/trunk/externals/frankenstein/; revision=4457
-rwxr-xr-xcommon.c124
-rwxr-xr-xcommon.h76
-rwxr-xr-xharmonizer.c25
-rwxr-xr-xrhythms_memory.sln21
-rwxr-xr-xthemes_memory.sln21
-rwxr-xr-xthemes_memory.suobin7680 -> 0 bytes
6 files changed, 207 insertions, 60 deletions
diff --git a/common.c b/common.c
index fdb5a78..9f9fc35 100755
--- a/common.c
+++ b/common.c
@@ -925,6 +925,124 @@ abs_note_t string2note(const char *substr)
chord_type_t string2mode(const char *substr)
{
+ // beware when adding new chords
+ // put shorter names at end of this function!
+ if (strstr(substr, "unison"))
+ return kUnison;
+ if (strstr(substr, "major 7th #5"))
+ return kMaj7s5;
+ if (strstr(substr, "major 7th b5"))
+ return kMaj7b5;
+ if (strstr(substr, "dominant 7th #5"))
+ return kDom7s5;
+ if (strstr(substr, "dominant 7th b5"))
+ return kDom7b5;
+ if (strstr(substr, "half diminished 9th"))
+ return kHalfDim9;
+ if (strstr(substr, "minor major 9th"))
+ return kMinMaj9;
+ if (strstr(substr, "diminished major 9th"))
+ return kDimMaj9;
+ if (strstr(substr, "major 9th b5"))
+ return kMaj9b5;
+ if (strstr(substr, "dominant 9th b5"))
+ return kDom9b5;
+ if (strstr(substr, "dominant 9th b13"))
+ return kDom9b13;
+ if (strstr(substr, "minor 9th #11"))
+ return kMin9s11;
+ if (strstr(substr, "minor/maj 9th b11"))
+ return kmM9b11;
+ if (strstr(substr, "major 7th b9"))
+ return kMaj7b9;
+ if (strstr(substr, "major 7th #5 b9"))
+ return kMaj7s5b9;
+ if (strstr(substr, "dominant 7th b9"))
+ return kDom7b9;
+ if (strstr(substr, "minor 7th b9"))
+ return kMin7b9;
+ if (strstr(substr, "minor b9 #11"))
+ return kMinb9s11;
+ if (strstr(substr, "half diminished b9"))
+ return kHalfDimb9;
+ if (strstr(substr, "diminished b9"))
+ return kDim7b9;
+ if (strstr(substr, "minor/major b9"))
+ return kMinMajb9;
+ if (strstr(substr, "diminished M7 b9"))
+ return kDimMajb9;
+ if (strstr(substr, "major 7th #9"))
+ return kMaj7s9;
+ if (strstr(substr, "dominant #9"))
+ return kDom7s9;
+ if (strstr(substr, "major 7th #11"))
+ return kMaj7s11;
+ if (strstr(substr, "major 9th #13"))
+ return kMaj9s13;
+ if (strstr(substr, "major #9 #11"))
+ return kMs9s11;
+ if (strstr(substr, "half diminished b11"))
+ return kHDimb11;
+ if (strstr(substr, "major 11th"))
+ return kMaj11;
+ if (strstr(substr, "dominant 11th"))
+ return kDom11;
+ if (strstr(substr, "minor 11th"))
+ return kMin11;
+ if (strstr(substr, "half diminished 11th"))
+ return kHalfDim11;
+ if (strstr(substr, "diminished 11th"))
+ return kDim11;
+ if (strstr(substr, "minor/major 11th"))
+ return kMinMaj11;
+ if (strstr(substr, "diminished maj 11th"))
+ return kDimMaj11;
+ if (strstr(substr, "major 11th b5"))
+ return kMaj11b5;
+ if (strstr(substr, "major 11th #5"))
+ return kMaj11s5;
+ if (strstr(substr, "major 11th b9"))
+ return kMaj11b9;
+ if (strstr(substr, "major 11th #9"))
+ return kMaj11s9;
+ if (strstr(substr, "major 11th b13"))
+ return kMaj11b13;
+ if (strstr(substr, "major 11th #13"))
+ return kMaj11s13;
+ if (strstr(substr, "major 11th b5 b9"))
+ return kM11b5b9;
+ if (strstr(substr, "dominant 11th b5"))
+ return kDom11b5;
+ if (strstr(substr, "dominant 11th b9"))
+ return kDom11b9;
+ if (strstr(substr, "dominant 11th #9"))
+ return kDom11s9;
+ if (strstr(substr, "half dim 11th b9"))
+ return kHalfDim11b9;
+ if (strstr(substr, "dominant #11"))
+ return kDom7s11;
+ if (strstr(substr, "minor 7th #11"))
+ return kMin7s11;
+ if (strstr(substr, "dominant 13th #11"))
+ return kDom13s11;
+ if (strstr(substr, "major 7 b9 13"))
+ return kM7b913;
+ if (strstr(substr, "major 7th #13"))
+ return kMaj7s13;
+ if (strstr(substr, "major 7 b9 #13"))
+ return kM7b9s13;
+ if (strstr(substr, "dominant 7th b13"))
+ return kDom7b13;
+ if (strstr(substr, "chromatic"))
+ return kChrom;
+ if (strstr(substr, "dominant b9"))
+ return kDomb9;
+ if (strstr(substr, "major 9th"))
+ return kMaj9;
+ if (strstr(substr, "dominant 9th"))
+ return kDom9;
+ if (strstr(substr, "minor 9th"))
+ return kMin9;
if (strstr(substr, "minor/major 7th"))
return kMinMaj7;
if (strstr(substr, "major 7th"))
@@ -945,9 +1063,7 @@ chord_type_t string2mode(const char *substr)
return kAug;
if (strstr(substr, "dominant 7th"))
return kDom7;
- // TODO: other chords
- // beware when adding new chords
- // put shorter names at end of this function!
- return C;
+
+ return kUnison;
}
diff --git a/common.h b/common.h
index f30bda4..90d0190 100755
--- a/common.h
+++ b/common.h
@@ -131,8 +131,9 @@ struct t_rhythm_memory_representation
// chords data structure
// tells you how many durations there // how can a chord be?
-#define TYPES_NUM 17 // keep me updated
+#define TYPES_NUM 69 // keep me updated
typedef enum {
+ /*
kMaj=0,
kMin=1,
kDim=2,
@@ -150,7 +151,78 @@ typedef enum {
kMin9=13,
kHalfDim9=14,
kMinMaj9=15,
- kDimMaj9=16
+ kDimMaj9=16
+*/
+ // this enumerators are from maxlib chord
+ kUnison = 0,
+kMaj = 1,
+kMin = 2,
+kDim = 3,
+kAug = 4,
+kMaj7 = 5,
+kDom7 = 6,
+kMin7 = 7,
+kHalfDim7 = 8,
+kDim7 = 9,
+kMinMaj7 = 10,
+kMaj7s5 = 11,
+kMaj7b5 = 12,
+kDom7s5 = 13,
+kDom7b5 = 14,
+kDomb9 = 15,
+kMaj9 = 16,
+kDom9 = 17,
+kMin9 = 18,
+kHalfDim9 = 19,
+kMinMaj9 = 20,
+kDimMaj9 = 21,
+kMaj9b5 = 22,
+kDom9b5 = 23,
+kDom9b13 = 24,
+kMin9s11 = 25,
+kmM9b11 = 26,
+kMaj7b9 = 27,
+kMaj7s5b9 = 28,
+kDom7b9 = 29,
+kMin7b9 = 30,
+kMinb9s11 = 31,
+kHalfDimb9 = 32,
+kDim7b9 = 33,
+kMinMajb9 = 34,
+kDimMajb9 =35,
+kMaj7s9 = 36,
+kDom7s9 = 37,
+kMaj7s11 = 38,
+kMs9s11 = 39,
+kHDimb11 = 40,
+kMaj11 = 41,
+kDom11 = 42,
+kMin11 = 43,
+kHalfDim11 = 44,
+kDim11 = 45,
+kMinMaj11 =46,
+kDimMaj11 =47,
+kMaj11b5 = 48,
+kMaj11s5 = 49,
+kMaj11b9 = 50,
+kMaj11s9 = 51,
+kMaj11b13 = 52,
+kMaj11s13 = 53,
+kM11b5b9 = 54,
+kDom11b5 = 55,
+kDom11b9 = 56,
+kDom11s9 = 57,
+kHalfDim11b9 = 58,
+kDom7s11 = 59,
+kMin7s11 = 60,
+kDom13s11 = 61,
+kM7b913 = 62,
+kMaj7s13 = 63,
+kMaj9s13 = 64,
+kM7b9s13 = 65,
+kDom7b13 = 66,
+kChrom = 67,
+kNone = 68
} chord_type_t;
// how many tones do we have in our octave?
diff --git a/harmonizer.c b/harmonizer.c
index fc588f7..39c74b6 100755
--- a/harmonizer.c
+++ b/harmonizer.c
@@ -44,7 +44,7 @@ or at least set the importance of rules in realtime..
#define NOTES_RANGE 80 // this should be multiple of 16
#define LOWER_POSSIBLE_NOTE 24 // lower note possible, it should be a C
-#define POSSIBLE_NOTES (NOTES_RANGE/12*4) // 4 is the max number of notes in a chord
+#define POSSIBLE_NOTES (NOTES_RANGE/12*5) // 5 is the max number of notes in a chord
// default values
#define DEF_WIDENESS 3 // 3 octaves
@@ -95,22 +95,22 @@ typedef struct _harmonizer
void build_possible_notes_table(t_harmonizer *x)
{
int i, octave, basenote;
- int n1, n2, n3, n4;
+ int n1, n2, n3, n4, n5;
n1=n2=n3=n4=0; // there always is the fundamental
if (DEBUG_VERBOSE)
post("build_possible_notes_table target_chord.mode=%i target_chord.note=%i", x->target_chord.mode, x->target_chord.note);
switch (x->target_chord.mode)
{
- case kMaj: n2=4; n3=7; n4=0;break;
- case kMin: n2=3; n3=7; n4=0;break;
- case kDim: n2=3; n3=6; n4=0;break;
- case kAug: n2=4; n3=8; n4=0;break;
- case kMaj7: n2=4; n3=7; n4=11;break;
- case kDom7: n2=4; n3=7; n4=10;break;
- case kMin7: n2=3; n3=7; n4=10;break;
- case kHalfDim7: n2=3; n3=6; n4=10;break;
- case kDim7: n2=3; n3=6; n4=9;break;
- case kMinMaj7: n2=4; n3=7; n4=11;break;
+ case kMaj: n2=4; n3=7; n4=0;n5=0;break;
+ case kMin: n2=3; n3=7; n4=0;n5=0;break;
+ case kDim: n2=3; n3=6; n4=0;n5=0;break;
+ case kAug: n2=4; n3=8; n4=0;n5=0;break;
+ case kMaj7: n2=4; n3=7; n4=11;n5=0;break;
+ case kDom7: n2=4; n3=7; n4=10;n5=0;break;
+ case kMin7: n2=3; n3=7; n4=10;n5=0;break;
+ case kHalfDim7: n2=3; n3=6; n4=10;n5=0;break;
+ case kDim7: n2=3; n3=6; n4=9;n5=0;break;
+ case kMinMaj7: n2=4; n3=7; n4=11;n5=0;break;
}
if (DEBUG_VERBOSE)
post("build_possible_notes_table n2=%i n3=%i n4=%i", n2, n3, n4);
@@ -141,6 +141,7 @@ void build_possible_notes_table(t_harmonizer *x)
x->target_notes[i++]=octave*12 + LOWER_POSSIBLE_NOTE + basenote + n2;
x->target_notes[i++]=octave*12 + LOWER_POSSIBLE_NOTE + basenote + n3;
x->target_notes[i++]=octave*12 + LOWER_POSSIBLE_NOTE + basenote + n4;
+ x->target_notes[i++]=octave*12 + LOWER_POSSIBLE_NOTE + basenote + n5;
octave++;
}
if (DEBUG_VERBOSE)
diff --git a/rhythms_memory.sln b/rhythms_memory.sln
deleted file mode 100755
index cfb67b0..0000000
--- a/rhythms_memory.sln
+++ /dev/null
@@ -1,21 +0,0 @@
-Microsoft Visual Studio Solution File, Format Version 7.00
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "rhythms_memory", "rhythms_memory.vcproj", "{DBC75D2A-816A-4C0A-8FE7-2016518D2D19}"
-EndProject
-Global
- GlobalSection(SolutionConfiguration) = preSolution
- ConfigName.0 = Debug
- ConfigName.1 = Release
- EndGlobalSection
- GlobalSection(ProjectDependencies) = postSolution
- EndGlobalSection
- GlobalSection(ProjectConfiguration) = postSolution
- {DBC75D2A-816A-4C0A-8FE7-2016518D2D19}.Debug.ActiveCfg = Debug|Win32
- {DBC75D2A-816A-4C0A-8FE7-2016518D2D19}.Debug.Build.0 = Debug|Win32
- {DBC75D2A-816A-4C0A-8FE7-2016518D2D19}.Release.ActiveCfg = Release|Win32
- {DBC75D2A-816A-4C0A-8FE7-2016518D2D19}.Release.Build.0 = Release|Win32
- EndGlobalSection
- GlobalSection(ExtensibilityGlobals) = postSolution
- EndGlobalSection
- GlobalSection(ExtensibilityAddIns) = postSolution
- EndGlobalSection
-EndGlobal
diff --git a/themes_memory.sln b/themes_memory.sln
deleted file mode 100755
index 4ff3387..0000000
--- a/themes_memory.sln
+++ /dev/null
@@ -1,21 +0,0 @@
-Microsoft Visual Studio Solution File, Format Version 7.00
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "themes_memory", "themes_memory.vcproj", "{DBC75D2A-816A-4C0A-8FE7-2016518D2D19}"
-EndProject
-Global
- GlobalSection(SolutionConfiguration) = preSolution
- ConfigName.0 = Debug
- ConfigName.1 = Release
- EndGlobalSection
- GlobalSection(ProjectDependencies) = postSolution
- EndGlobalSection
- GlobalSection(ProjectConfiguration) = postSolution
- {DBC75D2A-816A-4C0A-8FE7-2016518D2D19}.Debug.ActiveCfg = Debug|Win32
- {DBC75D2A-816A-4C0A-8FE7-2016518D2D19}.Debug.Build.0 = Debug|Win32
- {DBC75D2A-816A-4C0A-8FE7-2016518D2D19}.Release.ActiveCfg = Release|Win32
- {DBC75D2A-816A-4C0A-8FE7-2016518D2D19}.Release.Build.0 = Release|Win32
- EndGlobalSection
- GlobalSection(ExtensibilityGlobals) = postSolution
- EndGlobalSection
- GlobalSection(ExtensibilityAddIns) = postSolution
- EndGlobalSection
-EndGlobal
diff --git a/themes_memory.suo b/themes_memory.suo
deleted file mode 100755
index 07c81e2..0000000
--- a/themes_memory.suo
+++ /dev/null
Binary files differ