diff --git a/Staff.xcodeproj/project.pbxproj b/Staff.xcodeproj/project.pbxproj index e43f9e1..ae5fa79 100644 --- a/Staff.xcodeproj/project.pbxproj +++ b/Staff.xcodeproj/project.pbxproj @@ -284,7 +284,6 @@ 2AF14AB7154715A200C899B2 /* dashedlineAccidental.h */, 2AF14AB8154715A200C899B2 /* dashedlineAccidental.m */, 2AAF8E851555B9F900F31082 /* scaledot.png */, - 0826BDCF1523E5C2004A9B22 /* StaffController.h */, 2A94A4DE1542622000766EAF /* AccidentalsController.h */, 2A94A4DF1542622000766EAF /* AccidentalsController.m */, 2AE1DE8215154B72008C538D /* AppDelegate.h */, @@ -354,6 +353,8 @@ A7A180C3154EF70600712D92 /* solidVerticalLine.m */, 2AF14AB8154715A200C899B2 /* dashedlineAccidental.m */, 0826BDCF1523E5C2004A9B22 /* StaffController.h */, + 0826BDC51523E5C2004A9B22 /* MainController.h */, + 0826BDCF1523E5C2004A9B22 /* StaffController.h */, 0826BDD01523E5C2004A9B22 /* StaffController.m */, 0826BDC51523E5C2004A9B22 /* MainController.h */, 08ACF4BB152B9D1F00512760 /* star.png */, diff --git a/Staff.xcodeproj/project.xcworkspace/xcuserdata/aarontietz.xcuserdatad/UserInterfaceState.xcuserstate b/Staff.xcodeproj/project.xcworkspace/xcuserdata/aarontietz.xcuserdatad/UserInterfaceState.xcuserstate index b73156a..ad56f8c 100644 Binary files a/Staff.xcodeproj/project.xcworkspace/xcuserdata/aarontietz.xcuserdatad/UserInterfaceState.xcuserstate and b/Staff.xcodeproj/project.xcworkspace/xcuserdata/aarontietz.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/Staff.xcodeproj/project.xcworkspace/xcuserdata/christopherharris.xcuserdatad/UserInterfaceState.xcuserstate b/Staff.xcodeproj/project.xcworkspace/xcuserdata/christopherharris.xcuserdatad/UserInterfaceState.xcuserstate index d30e241..e66a7a9 100644 Binary files a/Staff.xcodeproj/project.xcworkspace/xcuserdata/christopherharris.xcuserdatad/UserInterfaceState.xcuserstate and b/Staff.xcodeproj/project.xcworkspace/xcuserdata/christopherharris.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/Staff/Chord.h b/Staff/Chord.h index cfc2acf..2631a98 100644 --- a/Staff/Chord.h +++ b/Staff/Chord.h @@ -18,6 +18,7 @@ @property (nonatomic, retain) NSString* key; -(id)initWithName:(NSString*)name Notes:(NSArray*)notes andID:(int)number; +-(id)initWithName:(NSString*)aName Notes:(NSArray*)someNotes andKey:(NSString*)aKey; -(void)setupKey:(NSString*)aKey; -(void)resetValues; diff --git a/Staff/Chord.m b/Staff/Chord.m index c6ff084..f090c16 100644 --- a/Staff/Chord.m +++ b/Staff/Chord.m @@ -26,6 +26,20 @@ -(id)initWithName:(NSString*)aName Notes:(NSArray*)someNotes andID:(int)num{ return self; } +-(id)initWithName:(NSString*)aName Notes:(NSArray*)someNotes andKey:(NSString*)aKey{ + self = [super init]; + + if(self){ + name = aName; + notes = someNotes; + key = aKey; + beatsPerMeasure = 1; + numberOfMeasures = 1; + } + + return self; +} + -(void)setupKey:(NSString*)aKey{ key = aKey; } diff --git a/Staff/ChordViewController.h b/Staff/ChordViewController.h index 7a3222d..81d0757 100755 --- a/Staff/ChordViewController.h +++ b/Staff/ChordViewController.h @@ -11,6 +11,7 @@ #import "ChordInstrumentsController.h" #import "CircleOfFifthsViewController.h" #import "solidVerticalLine.h" +#import "Circleof5thsController.h" @interface ChordViewController : UIViewController { @@ -112,7 +113,7 @@ @property (nonatomic, retain) UIButton *circleOfFifthsButton; @property (nonatomic, retain) UIPopoverController *circleOfFifthsPopoverController; -@property (nonatomic, retain) CircleOfFifthsViewController *circleOfFirthsViewController; +@property (nonatomic, retain) Circleof5thsController *circleOfFifthsViewController; @property (nonatomic, retain) IBOutlet UISlider *chordVolume; diff --git a/Staff/ChordViewController.m b/Staff/ChordViewController.m index cda3375..6e7e8f4 100755 --- a/Staff/ChordViewController.m +++ b/Staff/ChordViewController.m @@ -20,7 +20,7 @@ @implementation ChordViewController @synthesize bpmLabel; @synthesize metronomeOnOff; @synthesize metronomeTimer; -@synthesize topMenu, instrumentsButton, instumentPopoverController, instrumentsController, chordVolume, circleOfFirthsViewController, circleOfFifthsButton, circleOfFifthsPopoverController; +@synthesize topMenu, instrumentsButton, instumentPopoverController, instrumentsController, chordVolume, circleOfFifthsViewController, circleOfFifthsButton, circleOfFifthsPopoverController; #define GROW_ANIMATION_DURATION_SECONDS 0.15 // Determines how fast a piece size grows when it is moved. #define SHRINK_ANIMATION_DURATION_SECONDS 0.15 // Determines how fast a piece size shrinks when a piece stops moving. @@ -92,7 +92,7 @@ - (void)buildTopMenu topMenu = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 624, 70)]; [topMenu setBackgroundColor:[UIColor colorWithRed:100.0/255 green:100.0/255 blue:100.0/255 alpha:1.0]]; - circleOfFirthsViewController = [[CircleOfFifthsViewController alloc]init]; + circleOfFifthsViewController = [[Circleof5thsController alloc]init]; circleOfFifthsButton = [[UIButton alloc] initWithFrame:CGRectMake(450, 10, 150, 50)]; [circleOfFifthsButton setBackgroundColor:[UIColor colorWithRed:170.0/255 green:170.0/255 blue:170.0/255 alpha:1.0]]; @@ -134,9 +134,6 @@ - (void)buildTopMenu [topMenu addSubview:instrumentsButton]; [topMenu addSubview:circleOfFifthsButton]; [self.view addSubview:topMenu]; - - //[self.view addSubview:instrumentsButton]; - //[self.view addSubview:circleOfFifthsButton]; solidVerticalLine *divider = [[solidVerticalLine alloc] initWithFrame:CGRectMake(0, 0, 2, 70)]; [divider addSubview:[self deepCopySolidVerticalLine:[[solidVerticalLine alloc]init]]]; @@ -172,10 +169,12 @@ -(IBAction)openCircleOfFifthsMenu:(id)sender{ [circleOfFifthsPopoverController dismissPopoverAnimated:YES]; return; } - circleOfFifthsPopoverController = [[UIPopoverController alloc] initWithContentViewController:circleOfFirthsViewController]; + circleOfFifthsPopoverController = [[UIPopoverController alloc] initWithContentViewController:circleOfFifthsViewController]; [circleOfFifthsPopoverController presentPopoverFromBarButtonItem:sender permittedArrowDirections:UIPopoverArrowDirectionUp animated:YES]; - [circleOfFifthsPopoverController setPopoverContentSize:CGSizeMake(510, 510)]; + //[circleOfFifthsPopoverController setPopoverContentSize:CGSizeMake(550, 550)]; + [circleOfFifthsPopoverController setPopoverContentSize:CGSizeMake(260, 250)]; + } -(void) layoutChordPickers diff --git a/Staff/Circleof5thsController.m b/Staff/Circleof5thsController.m index 66d7795..6443e9d 100644 --- a/Staff/Circleof5thsController.m +++ b/Staff/Circleof5thsController.m @@ -70,18 +70,8 @@ - (void)setup [circleOf5thsPicker setDataSource:self]; [circleOf5thsPicker setShowsSelectionIndicator:YES]; - /* - circleOf5thsButton = [[UIButton alloc] initWithFrame:CGRectMake(60, 240, 250, 50)]; - [circleOf5thsButton setTitle:@"Select" forState:UIControlStateNormal]; - [[circleOf5thsButton layer] setBorderWidth:1]; - [[circleOf5thsButton layer] setBorderColor:[UIColor colorWithRed:204.0/255 green:204.0/255 blue:204.0/255 alpha:1].CGColor]; - [circleOf5thsButton setTitleColor:[UIColor blackColor] forState:UIControlStateNormal]; - [[circleOf5thsButton layer] setCornerRadius:10]; - */ - [circleOf5thsView addSubview:circleOf5thsTab]; [circleOf5thsView addSubview:circleOf5thsPicker]; - //[circleOf5thsView addSubview:circleOf5thsButton]; [mainDelegate.viewController.chordController.view addSubview:circleOf5thsView]; [circleOf5thsPicker selectRow:6 inComponent:0 animated:YES]; diff --git a/Staff/DataController.m b/Staff/DataController.m index c51c108..b254c72 100644 --- a/Staff/DataController.m +++ b/Staff/DataController.m @@ -93,7 +93,7 @@ -(void)fillKeySignatureAccidentals{ /** b: B **/ - NSArray *FMajor = [[NSArray alloc] initWithObjects:B3, + NSArray *FMajor = [[NSArray alloc] initWithObjects:F4, none,none,none,none, none,none,none,flat, none,none,none,none, @@ -506,15 +506,14 @@ -(void) fillChordsDictionary{ Maj: I, ii, iii, IV, V, V7, vi min: i, iiĀ°, III, iv, V, V7, VI */ + + [self setUpFriendChords]; _majorKeyChordFormulas = [[NSArray alloc]initWithObjects: Maj, min, min, Maj, Maj, dom7, min, rest, nil]; _minorKeyChordFormulas = [[NSArray alloc]initWithObjects: min, dim, Maj, min, Maj, dom7, Maj, rest, nil]; - - [self setUpFriendChords]; - } -(void)setUpFriendChords{ @@ -630,7 +629,34 @@ -(void)setUpFriendChords{ // name with, e.g. "F" + "Maj" -(NSArray*)setUpChordsToSendWithRootKey:(NSString*)root{ NSArray *friends = [_friendChords objectForKey:root]; + if(isupper([_currentKey characterAtIndex:0])) { + _currentChords = [_majorKeyChordFormulas mutableCopy]; + } + else{ + _currentChords = [_minorKeyChordFormulas mutableCopy]; + } + int pos = 0; + + Chord *one = [[Chord alloc] initWithName:[[_currentChords objectAtIndex:0] name] Notes:[[_currentChords objectAtIndex:0] notes] + andKey:[friends objectAtIndex:0]]; + Chord *two = [[Chord alloc] initWithName:[[_currentChords objectAtIndex:1] name] Notes:[[_currentChords objectAtIndex:1] notes] + andKey:[friends objectAtIndex:1]]; + Chord *three = [[Chord alloc] initWithName:[[_currentChords objectAtIndex:2] name] Notes:[[_currentChords objectAtIndex:2] notes] + andKey:[friends objectAtIndex:2]]; + Chord *four = [[Chord alloc] initWithName:[[_currentChords objectAtIndex:3] name] Notes:[[_currentChords objectAtIndex:3] notes] + andKey:[friends objectAtIndex:3]]; + Chord *five = [[Chord alloc] initWithName:[[_currentChords objectAtIndex:4] name] Notes:[[_currentChords objectAtIndex:4] notes] + andKey:[friends objectAtIndex:4]]; + Chord *six = [[Chord alloc] initWithName:[[_currentChords objectAtIndex:5] name] Notes:[[_currentChords objectAtIndex:5] notes] + andKey:[friends objectAtIndex:5]]; + Chord *seven = [[Chord alloc] initWithName:[[_currentChords objectAtIndex:6] name] Notes:[[_currentChords objectAtIndex:6] notes] + andKey:[friends objectAtIndex:6]]; + Chord *eight = [[Chord alloc] initWithName:[[_currentChords objectAtIndex:7] name] Notes:[[_currentChords objectAtIndex:7] notes] + andKey:[friends objectAtIndex:7]]; + + _currentChords =[[NSArray alloc] initWithObjects:one, two, three, four, five, six, seven, eight, nil]; + NSArray* toSend = [_currentChords mutableCopy]; NSLog(@"Creating chords to send:"); for(Chord *c in toSend){ @@ -655,13 +681,6 @@ -(void)keySignatureWasChosen:(NSString*)choice _currentKeySignatureNotes = [_keySignatureNoteMap objectForKey:choice]; _currentKey = choice; - if(isupper([choice characterAtIndex:0])) { - _currentChords = [_majorKeyChordFormulas mutableCopy]; - } - else{ - _currentChords = [_minorKeyChordFormulas mutableCopy]; - } - AppDelegate *mainDelegate = (AppDelegate*)[[UIApplication sharedApplication]delegate]; [mainDelegate.viewController.staffController changeScale:keySignaturetoDraw]; [mainDelegate.viewController.chordController setUpChords:[self setUpChordsToSendWithRootKey:choice]]; diff --git a/Staff/StaffController.m b/Staff/StaffController.m index 4d21c04..95f88c2 100644 --- a/Staff/StaffController.m +++ b/Staff/StaffController.m @@ -340,13 +340,13 @@ -(void)setDotAt:(int)location { // hide old dot - [[dots objectForKey:[[NSString alloc] initWithFormat:@"%d", currentDotLocation]] setHidden:TRUE]; + [[dots objectForKey:[[NSString alloc] initWithFormat:@"%d", currentDotLocation+4]] setHidden:TRUE]; // show new dot NSLog(@"Dot LOC: %d",location); NSLog(@"Dot STR: %@", [[NSString alloc] initWithFormat:@"%d", location]); NSLog(@"Dot OBJ: %@",[dots objectForKey:[[NSString alloc] initWithFormat:@"%d", location]]); - [[dots objectForKey:[[NSString alloc] initWithFormat:@"%d", location]] setHidden:FALSE]; + [[dots objectForKey:[[NSString alloc] initWithFormat:@"%d", location+4]] setHidden:FALSE]; } - (void)findAccidentalNote:(int)pos