Permalink
Browse files

latest

  • Loading branch information...
2 parents 8e90339 + 22fdb3c commit cf67dca67804177c62b951f660a122729c47d059 @cnharris10 cnharris10 committed May 5, 2012
View
60 Staff.xcodeproj/project.pbxproj
@@ -52,12 +52,14 @@
A717FEDF1534ED9D00515250 /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A717FEDE1534ED9D00515250 /* CoreFoundation.framework */; };
A717FEE21534EE1300515250 /* Security.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A717FEE11534EE1300515250 /* Security.framework */; };
A732C771154F6E3100EE6845 /* CircleOfFifthsViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = A732C770154F6E3100EE6845 /* CircleOfFifthsViewController.m */; };
- A74531581552388200BF3E43 /* crsynth.dlsc in Resources */ = {isa = PBXBuildFile; fileRef = A74531511552388200BF3E43 /* crsynth.dlsc */; };
- A74531591552388200BF3E43 /* libcrmpd.a in Frameworks */ = {isa = PBXBuildFile; fileRef = A74531531552388200BF3E43 /* libcrmpd.a */; };
- A745315A1552388200BF3E43 /* libcrse.a in Frameworks */ = {isa = PBXBuildFile; fileRef = A74531541552388200BF3E43 /* libcrse.a */; };
- A745315B1552388200BF3E43 /* libcrmpd.a in Frameworks */ = {isa = PBXBuildFile; fileRef = A74531561552388200BF3E43 /* libcrmpd.a */; };
- A745315C1552388200BF3E43 /* libcrse.a in Frameworks */ = {isa = PBXBuildFile; fileRef = A74531571552388200BF3E43 /* libcrse.a */; };
A765348B15276051001885E9 /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A765348A15276051001885E9 /* AudioToolbox.framework */; };
+ A785F7801553096400191D36 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A785F77F1553096400191D36 /* QuartzCore.framework */; };
+ A785F78715530EB400191D36 /* CircleView.m in Sources */ = {isa = PBXBuildFile; fileRef = A785F78615530EB400191D36 /* CircleView.m */; };
+ A785F78A1553244F00191D36 /* crsynth.dlsc in Resources */ = {isa = PBXBuildFile; fileRef = A785F7891553244F00191D36 /* crsynth.dlsc */; };
+ A785F7911553245B00191D36 /* libcrmpd.a in Frameworks */ = {isa = PBXBuildFile; fileRef = A785F78C1553245B00191D36 /* libcrmpd.a */; };
+ A785F7921553245B00191D36 /* libcrse.a in Frameworks */ = {isa = PBXBuildFile; fileRef = A785F78D1553245B00191D36 /* libcrse.a */; };
+ A785F7931553245B00191D36 /* libcrmpd.a in Frameworks */ = {isa = PBXBuildFile; fileRef = A785F78F1553245B00191D36 /* libcrmpd.a */; };
+ A785F7941553245B00191D36 /* libcrse.a in Frameworks */ = {isa = PBXBuildFile; fileRef = A785F7901553245B00191D36 /* libcrse.a */; };
A7A180C4154EF70600712D92 /* solidVerticalLine.m in Sources */ = {isa = PBXBuildFile; fileRef = A7A180C3154EF70600712D92 /* solidVerticalLine.m */; };
/* End PBXBuildFile section */
@@ -130,13 +132,16 @@
A717FEE11534EE1300515250 /* Security.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Security.framework; path = System/Library/Frameworks/Security.framework; sourceTree = SDKROOT; };
A732C76F154F6E3100EE6845 /* CircleOfFifthsViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CircleOfFifthsViewController.h; sourceTree = "<group>"; };
A732C770154F6E3100EE6845 /* CircleOfFifthsViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CircleOfFifthsViewController.m; sourceTree = "<group>"; };
- A74531501552388200BF3E43 /* crmd.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = crmd.h; sourceTree = "<group>"; };
- A74531511552388200BF3E43 /* crsynth.dlsc */ = {isa = PBXFileReference; lastKnownFileType = file; path = crsynth.dlsc; sourceTree = "<group>"; };
- A74531531552388200BF3E43 /* libcrmpd.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libcrmpd.a; sourceTree = "<group>"; };
- A74531541552388200BF3E43 /* libcrse.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libcrse.a; sourceTree = "<group>"; };
- A74531561552388200BF3E43 /* libcrmpd.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libcrmpd.a; sourceTree = "<group>"; };
- A74531571552388200BF3E43 /* libcrse.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libcrse.a; sourceTree = "<group>"; };
A765348A15276051001885E9 /* AudioToolbox.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AudioToolbox.framework; path = System/Library/Frameworks/AudioToolbox.framework; sourceTree = SDKROOT; };
+ A785F77F1553096400191D36 /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; };
+ A785F78515530EB400191D36 /* CircleView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CircleView.h; sourceTree = "<group>"; };
+ A785F78615530EB400191D36 /* CircleView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CircleView.m; sourceTree = "<group>"; };
+ A785F7881553244F00191D36 /* crmd.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = crmd.h; sourceTree = "<group>"; };
+ A785F7891553244F00191D36 /* crsynth.dlsc */ = {isa = PBXFileReference; lastKnownFileType = file; path = crsynth.dlsc; sourceTree = "<group>"; };
+ A785F78C1553245B00191D36 /* libcrmpd.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libcrmpd.a; sourceTree = "<group>"; };
+ A785F78D1553245B00191D36 /* libcrse.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libcrse.a; sourceTree = "<group>"; };
+ A785F78F1553245B00191D36 /* libcrmpd.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libcrmpd.a; sourceTree = "<group>"; };
+ A785F7901553245B00191D36 /* libcrse.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libcrse.a; sourceTree = "<group>"; };
A7A180C2154EF70600712D92 /* solidVerticalLine.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = solidVerticalLine.h; sourceTree = "<group>"; };
A7A180C3154EF70600712D92 /* solidVerticalLine.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = solidVerticalLine.m; sourceTree = "<group>"; };
/* End PBXFileReference section */
@@ -146,6 +151,7 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
+ A785F7801553096400191D36 /* QuartzCore.framework in Frameworks */,
A717FEE21534EE1300515250 /* Security.framework in Frameworks */,
A717FEDF1534ED9D00515250 /* CoreFoundation.framework in Frameworks */,
A765348B15276051001885E9 /* AudioToolbox.framework in Frameworks */,
@@ -216,6 +222,7 @@
2AE1DE7215154B72008C538D /* Frameworks */ = {
isa = PBXGroup;
children = (
+ A785F77F1553096400191D36 /* QuartzCore.framework */,
A717FEE11534EE1300515250 /* Security.framework */,
A717FEDE1534ED9D00515250 /* CoreFoundation.framework */,
A765348A15276051001885E9 /* AudioToolbox.framework */,
@@ -256,6 +263,8 @@
0826BDD01523E5C2004A9B22 /* StaffController.m */,
2A94A4DE1542622000766EAF /* AccidentalsController.h */,
2A94A4DF1542622000766EAF /* AccidentalsController.m */,
+ A785F78515530EB400191D36 /* CircleView.h */,
+ A785F78615530EB400191D36 /* CircleView.m */,
A732C76F154F6E3100EE6845 /* CircleOfFifthsViewController.h */,
A732C770154F6E3100EE6845 /* CircleOfFifthsViewController.m */,
2AB9BF68154795C9001E756E /* InstrumentsController.h */,
@@ -296,33 +305,33 @@
name = "Supporting Files";
sourceTree = "<group>";
};
- A74531521552388200BF3E43 /* Release-iphoneos */ = {
+ A76534921527B777001885E9 /* crsynth */ = {
isa = PBXGroup;
children = (
- A74531531552388200BF3E43 /* libcrmpd.a */,
- A74531541552388200BF3E43 /* libcrse.a */,
+ A785F78B1553245B00191D36 /* Release-iphoneos */,
+ A785F78E1553245B00191D36 /* Release-iphonesimulator */,
+ A785F7881553244F00191D36 /* crmd.h */,
+ A785F7891553244F00191D36 /* crsynth.dlsc */,
);
- path = "Release-iphoneos";
+ path = crsynth;
sourceTree = "<group>";
};
- A74531551552388200BF3E43 /* Release-iphonesimulator */ = {
+ A785F78B1553245B00191D36 /* Release-iphoneos */ = {
isa = PBXGroup;
children = (
- A74531561552388200BF3E43 /* libcrmpd.a */,
- A74531571552388200BF3E43 /* libcrse.a */,
+ A785F78C1553245B00191D36 /* libcrmpd.a */,
+ A785F78D1553245B00191D36 /* libcrse.a */,
);
- path = "Release-iphonesimulator";
+ path = "Release-iphoneos";
sourceTree = "<group>";
};
- A76534921527B777001885E9 /* crsynth */ = {
+ A785F78E1553245B00191D36 /* Release-iphonesimulator */ = {
isa = PBXGroup;
children = (
- A74531501552388200BF3E43 /* crmd.h */,
- A74531511552388200BF3E43 /* crsynth.dlsc */,
- A74531521552388200BF3E43 /* Release-iphoneos */,
- A74531551552388200BF3E43 /* Release-iphonesimulator */,
+ A785F78F1553245B00191D36 /* libcrmpd.a */,
+ A785F7901553245B00191D36 /* libcrse.a */,
);
- path = crsynth;
+ path = "Release-iphonesimulator";
sourceTree = "<group>";
};
/* End PBXGroup section */
@@ -422,6 +431,7 @@
A732C771154F6E3100EE6845 /* CircleOfFifthsViewController.m in Sources */,
A705B21B154F9A980010D0B3 /* ChordInstrumentsController.m in Sources */,
08C9512A1550CB0A00D44C3E /* Circleof5thsController.m in Sources */,
+ A785F78715530EB400191D36 /* CircleView.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
View
BIN ...proj/project.xcworkspace/xcuserdata/aarontietz.xcuserdatad/UserInterfaceState.xcuserstate
Binary file not shown.
View
BIN ...oject.xcworkspace/xcuserdata/christopherharris.xcuserdatad/UserInterfaceState.xcuserstate
Binary file not shown.
View
2 Staff/ChordViewController.h
@@ -131,4 +131,6 @@
-(void) chordChosen_onTouchUpInside:(id)sender;
-(UIView *) deepCopySolidVerticalLine:(solidVerticalLine *)theView;
+- (IBAction)openCircleOfFifthsMenu:(id)sender;
+
@end
View
3 Staff/ChordViewController.m
@@ -152,7 +152,6 @@ - (UIView *)deepCopySolidVerticalLine:(solidVerticalLine *)theView
- (IBAction)openInstrumentsMenu:(id)sender
{
-// AppDelegate *mainDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
if([instumentPopoverController isPopoverVisible]){
[instumentPopoverController dismissPopoverAnimated:YES];
return;
@@ -164,6 +163,7 @@ - (IBAction)openInstrumentsMenu:(id)sender
}
-(IBAction)openCircleOfFifthsMenu:(id)sender{
+
if([circleOfFifthsPopoverController isPopoverVisible]){
[circleOfFifthsPopoverController dismissPopoverAnimated:YES];
return;
@@ -174,7 +174,6 @@ -(IBAction)openCircleOfFifthsMenu:(id)sender{
[circleOfFifthsPopoverController setPopoverContentSize:CGSizeMake(510, 510)];
}
-
-(void) layoutChordPickers
{
// Coordinates are relative to the parent container
View
2 Staff/CircleOfFifthsViewController.h
@@ -7,6 +7,8 @@
//
#import <UIKit/UIKit.h>
+#import "CircleView.h"
+
@interface CircleOfFifthsViewController : UIViewController
View
27 Staff/CircleOfFifthsViewController.m
@@ -5,25 +5,36 @@
// Created by Aaron Tietz on 4/30/12.
// Copyright (c) 2012 Tufts University. All rights reserved.
//
-
#import "CircleOfFifthsViewController.h"
-@interface CircleOfFifthsViewController ()
-
-@end
-
@implementation CircleOfFifthsViewController
@synthesize content = _content;
+-(id)init{
+ self = [super init];
+ if (self){
+ _content = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 500, 500)];
+ [_content setBackgroundColor:[UIColor whiteColor]];
+ [_content addSubview:[self deepCopyCircleView:_content]];
+ }
+ return self;
+}
+
- (void)viewDidLoad
{
[super viewDidLoad];
- _content = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 500, 500)];
- [_content setBackgroundColor:[UIColor blackColor]];
-
}
+- (UIView *)deepCopyCircleView:(UIView *)theView
+{
+ CircleView *newView = [[CircleView alloc] initWithFrame:[theView frame]];
+ [newView setBackgroundColor:[UIColor lightGrayColor]];
+ [newView setAlpha:0.5f];
+ return newView;
+}
+
+
-(void) touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event{
NSArray *allTouches = [touches allObjects];
for(UITouch* t in allTouches){
View
13 Staff/CircleView.h
@@ -0,0 +1,13 @@
+//
+// CircleView.h
+// Staff
+//
+// Created by Aaron Tietz on 5/3/12.
+// Copyright (c) 2012 Tufts University. All rights reserved.
+//
+
+#import <UIKit/UIKit.h>
+
+@interface CircleView : UIView
+
+@end
View
39 Staff/CircleView.m
@@ -0,0 +1,39 @@
+//
+// CircleView.m
+// Staff
+//
+// Created by Aaron Tietz on 5/3/12.
+// Copyright (c) 2012 Tufts University. All rights reserved.
+//
+
+#import "CircleView.h"
+
+@implementation CircleView
+
+- (id)initWithFrame:(CGRect)frame
+{
+ self = [super initWithFrame:frame];
+ if (self) {
+ self.backgroundColor = [UIColor whiteColor];
+ [self drawRect:frame];
+ }
+ return self;
+}
+
+
+- (void)drawRect:(CGRect)rect
+{
+ CGContextRef context = UIGraphicsGetCurrentContext();
+
+ CGContextSetLineWidth(context, 2.0);
+
+ CGContextSetStrokeColorWithColor(context, [UIColor blueColor].CGColor);
+
+ CGRect rectangle = CGRectMake(0,0,500,500);
+
+ CGContextAddEllipseInRect(context, rectangle);
+
+ CGContextStrokePath(context);}
+
+
+@end
View
3 Staff/Circleof5thsController.m
@@ -38,7 +38,8 @@ - (void)setup
{
AppDelegate *mainDelegate = (AppDelegate*)[[UIApplication sharedApplication]delegate];
circleOf5thsPickerElements = [[NSArray alloc]
- initWithObjects:@"F#",@"B",@"E",@"A",@"D",@"G",@"C",@"F",@"Bb",@"Eb",@"Ab",@"Db",@"Gb", nil];
+ initWithObjects:@"Gb/eb", @"Db/bb", @"Ab/f", @"Eb/c", @"Bb/g", @"F/d", @"C/a", @"G/e",
+ @"D/b", @"A/f#", @"E/c#", @"B/g#", @"F#/d#", nil];
// CHANGED THE SECOND PARAMETER TO 100 FROM 200
circleOf5thsView = [[UIView alloc] initWithFrame:CGRectMake(577, 250, 260, 250)];
View
143 Staff/DataController.m
@@ -36,7 +36,7 @@ -(BOOL) loadData{
}
// Initialize key signature choice to C
- [self setCurrentKeySignature:@"C"];
+ [self setCurrentKeySignature:@"C/a"];
[self keySignatureWasChosen:_currentKeySignature];
// Initialize staff and chord instruments to piano
@@ -64,126 +64,128 @@ -(void)fillKeySignatureAccidentals{
NSNumber *none = [[NSNumber alloc] initWithInt:0];
NSNumber *sharp = [[NSNumber alloc] initWithInt:1];
+ /*
NSNumber *B3 = [[NSNumber alloc] initWithInt:15];
NSNumber *C4 = [[NSNumber alloc] initWithInt:14];
NSNumber *D4 = [[NSNumber alloc] initWithInt:13];
NSNumber *E4 = [[NSNumber alloc] initWithInt:12];
NSNumber *F4 = [[NSNumber alloc] initWithInt:11];
NSNumber *G4 = [[NSNumber alloc] initWithInt:10];
NSNumber *A4 = [[NSNumber alloc] initWithInt:9];
+ */
// Create arrays for all keySignatures in the Circle of 5ths, where 1 is the first b
// above the treble clef and 15 the first b below 0 is a none note
// -1 is flat, and 1 is sharp. Position 0 is the starting point of the key
/** all natural notes **/
- NSArray *CMajor = [[NSArray alloc] initWithObjects:C4,
+ NSArray *CMajor = [[NSArray alloc] initWithObjects:
none,none,none,none,
none,none,none,none,
none,none,none,none,
none,none,none,nil];
-
+ /*
NSArray *AMinor = [[NSArray alloc] initWithObjects:A4,
none,none,none,none,
none,none,none,none,
none,none,none,none,
none,none,none,nil];
-
+ */
/** b: B **/
- NSArray *FMajor = [[NSArray alloc] initWithObjects:F4,
+ NSArray *FMajor = [[NSArray alloc] initWithObjects:
none,none,none,none,
none,none,none,flat,
none,none,none,none,
none,none,none,nil];
-
+ /*
NSArray *DMinor = [[NSArray alloc] initWithObjects:D4,
none,none,none,none,
none,none,none,flat,
none,none,none,none,
none,none,none,nil];
-
+ */
/** b: B, E **/
- NSArray *BflatMajor = [[NSArray alloc] initWithObjects:B3,
+ NSArray *BflatMajor = [[NSArray alloc] initWithObjects:
none,none,none,none,
flat,none,none,flat,
none,none,none,none,
none,none,none,nil];
-
+ /*
NSArray *GMinor = [[NSArray alloc] initWithObjects:G4,
none,none,none,none,
flat,none,none,flat,
none,none,none,none,
none,none,none,nil];
-
+ */
/** b: A, B, E **/
- NSArray *EflatMajor = [[NSArray alloc] initWithObjects:E4,
+ NSArray *EflatMajor = [[NSArray alloc] initWithObjects:
none,none,none,none,
flat,none,none,flat,
flat,none,none,none,
none,none,none,nil];
-
+ /*
NSArray *CMinor = [[NSArray alloc] initWithObjects:C4,
none,none,none,none,
flat,none,none,flat,
flat,none,none,none,
none,none,none,nil];
-
+ */
/** b: A, B, D, E **/
- NSArray *AflatMajor = [[NSArray alloc] initWithObjects:A4,
+ NSArray *AflatMajor = [[NSArray alloc] initWithObjects:
none,none,none,none,
flat,flat,none,flat,
flat,none,none,none,
none,none,none,nil];
-
+ /*
NSArray *FMinor = [[NSArray alloc] initWithObjects:F4,
none,none,none,none,
flat,flat,none,flat,
flat,none,none,none,
none,none,none,nil];
-
+ */
/** b: A, B, D, E, G **/
- NSArray *DflatMajor = [[NSArray alloc] initWithObjects:D4,
+ NSArray *DflatMajor = [[NSArray alloc] initWithObjects:
none,none,none,none,
flat,flat,none,flat,
flat,flat,none,none,
none,none,none,nil];
-
+ /*
NSArray *BflatMinor = [[NSArray alloc] initWithObjects:B3,
none,none,none,none,
flat,flat,none,flat,
flat,flat,none,none,
none,none,none,nil];
-
+ */
/** b: A, B, C, D, E, G **/
- NSArray *GflatMajor = [[NSArray alloc] initWithObjects:G4,
+ NSArray *GflatMajor = [[NSArray alloc] initWithObjects:
none,none,none,none,
flat,flat,flat,flat,
flat,flat,none,none,
none,none,none,nil];
-
+ /*
NSArray *EflatMinor = [[NSArray alloc] initWithObjects:E4,
none,none,none,none,
flat,flat,flat,flat,
flat,flat,none,none,
none,none,none,nil];
-
+ */
/** b: A, B, C, D, E, G, F **/
-
+ /*
NSArray *CflatMajor = [[NSArray alloc] initWithObjects:C4,
none,none,none,none,
flat,flat,flat,flat,
@@ -195,99 +197,104 @@ -(void)fillKeySignatureAccidentals{
flat,flat,flat,flat,
flat,flat,flat,none,
none,none,none,nil];
-
+ */
/** #: F **/
- NSArray *GMajor = [[NSArray alloc] initWithObjects:G4,
+ NSArray *GMajor = [[NSArray alloc] initWithObjects:
none,none,none,sharp,
none,none,none,none,
none,none,none,none,
none,none,none,nil];
-
+ /*
NSArray *EMinor = [[NSArray alloc] initWithObjects:E4,
none,none,none,sharp,
none,none,none,none,
none,none,none,none,
none,none,none,nil];
-
+ */
/** #: C, F **/
- NSArray *DMajor = [[NSArray alloc] initWithObjects:D4,
+ NSArray *DMajor = [[NSArray alloc] initWithObjects:
none,none,none,sharp,
none,none,sharp,none,
none,none,none,none,
none,none,none,nil];
-
+ /*
NSArray *BMinor = [[NSArray alloc] initWithObjects:B3,
none,none,none,sharp,
none,none,sharp,none,
none,none,none,none,
none,none,none,nil];
-
+ */
/** #: C, F, G **/
- NSArray *AMajor = [[NSArray alloc] initWithObjects:A4,
+ NSArray *AMajor = [[NSArray alloc] initWithObjects:
none,none,sharp,sharp,
none,none,sharp,none,
none,none,none,none,
none,none,none,nil];
-
+ /*
NSArray *FsharpMinor = [[NSArray alloc] initWithObjects:F4,
none,none,sharp,sharp,
none,none,sharp,none,
none,none,none,none,
none,none,none,nil];
-
+ */
/** #: C, D, F, G **/
- NSArray *EMajor = [[NSArray alloc] initWithObjects:E4,
+ NSArray *EMajor = [[NSArray alloc] initWithObjects:
none,none,sharp,sharp,
none,sharp,sharp,none,
none,none,none,none,
none,none,none,nil];
-
+ /*
NSArray *CsharpMinor = [[NSArray alloc] initWithObjects:C4,
none,none,sharp,sharp,
none,sharp,sharp,none,
none,none,none,none,
none,none,none,nil];
-
+ */
/** #: A, C, D, F, G **/
- NSArray *BMajor = [[NSArray alloc] initWithObjects:B3,
+ NSArray *BMajor = [[NSArray alloc] initWithObjects:
none,none,sharp,sharp,
none,sharp,sharp,none,
sharp,none,none,none,
none,none,none,nil];
-
+ /*
NSArray *GsharpMinor = [[NSArray alloc] initWithObjects:G4,
none,none,sharp,sharp,
none,sharp,sharp,none,
sharp,none,none,none,
none,none,none,nil];
+ */
/** #: A, C, D, E, F, G **/
- NSArray *FsharpMajor = [[NSArray alloc] initWithObjects:F4,
+ NSArray *FsharpMajor = [[NSArray alloc] initWithObjects:
none,none,sharp,sharp,
sharp,sharp,sharp,none,
sharp,none,none,none,
none,none,none,nil];
-
+
+ /*
NSArray *DsharpMinor = [[NSArray alloc] initWithObjects:D4,
none,none,sharp,sharp,
sharp,sharp,sharp,none,
sharp,none,none,none,
none,none,none,nil];
+ */
/** #: A, B, C, D, E, F, G **/
+ /*
+
NSArray *CsharpMajor = [[NSArray alloc] initWithObjects:C4,
none,none,sharp,sharp,
sharp,sharp,sharp,sharp,
@@ -299,15 +306,12 @@ -(void)fillKeySignatureAccidentals{
sharp,sharp,sharp,sharp,
sharp,none,none,none,
none,none,none,nil];
+ */
// Fill the keySignatures dictionary with each array and their corresponding key (to be the same as in the circle of fifths picker)
_keySignatureAccidentals = [[NSDictionary alloc] initWithObjectsAndKeys:
- CMajor, @"C", GMajor, @"G", DMajor, @"D", AMajor, @"A", EMajor, @"E",
- BMajor, @"B", FsharpMajor, @"F#", CsharpMajor, @"C#", CflatMajor, @"Cb", GflatMajor, @"Gb",
- DflatMajor, @"Db", AflatMajor, @"Ab", EflatMajor, @"Eb", BflatMajor, @"Bb", FMajor, @"F",
- AMinor, @"Am", EMinor, @"Em", BMinor, @"Bm", FsharpMinor, @"F#m", CsharpMinor, @"C#m",
- GsharpMinor, @"G#m", DsharpMinor, @"D# Minor", AsharpMinor, @"A#m", AflatMinor, @"Abm", EflatMinor, @"Ebm",
- BflatMinor, @"Bbm", FMinor, @"Fm", CMinor, @"Cm", GMinor, @"Gm", DMinor, @"Dm", nil];
+ GflatMajor, @"Gb/eb", DflatMajor, @"Db/bb", AflatMajor, @"Ab/f", EflatMajor, @"Eb/c", BflatMajor, @"Bb/g", FMajor, @"F/d",
+ CMajor, @"C/a", GMajor, @"G/e", DMajor, @"D/b", AMajor, @"A/f#", EMajor, @"E/c#", BMajor, @"B/g#", FsharpMajor, @"F#/d#", nil];
}
@@ -342,7 +346,7 @@ -(void)fillNotesInKeySignatureDictionary{
NSNumber *eightyOneNoteNum = [[NSNumber alloc] initWithInt:81];
NSNumber *eightyTwoNoteNum = [[NSNumber alloc] initWithInt:82];
NSNumber *eightyThreeNoteNum = [[NSNumber alloc] initWithInt:83];
- NSNumber *eightyFourNoteNum = [[NSNumber alloc] initWithInt:84];
+// NSNumber *eightyFourNoteNum = [[NSNumber alloc] initWithInt:84];
NSArray *CMajor = [[NSArray alloc] initWithObjects:eightyThreeNoteNum, eightyOneNoteNum, seventyNineNoteNum, seventySevenNoteNum,
@@ -372,7 +376,8 @@ -(void)fillNotesInKeySignatureDictionary{
NSArray *FsharpMajor = [[NSArray alloc] initWithObjects:eightyThreeNoteNum, eightyTwoNoteNum, eightyNoteNum, seventyEightNoteNum,
seventySevenNoteNum, seventyFiveNoteNum, seventyThreeNoteNum, seventyOneNoteNum, seventyNoteNum, sixtyEightNoteNum,
sixtySixNoteNum, sixtyFiveNoteNum, sixtyThreeNoteNum, sixtyOneNoteNum, fiftyNineNoteNum, nil];
-
+
+ /*
NSArray *CsharpMajor = [[NSArray alloc] initWithObjects:eightyFourNoteNum, eightyTwoNoteNum, eightyNoteNum, seventyEightNoteNum,
seventySevenNoteNum, seventyFiveNoteNum, seventyThreeNoteNum, seventyTwoNoteNum, seventyNoteNum, sixtyEightNoteNum,
sixtySixNoteNum, sixtyFiveNoteNum, sixtyThreeNoteNum, sixtyOneNoteNum, sixtyNoteNum, nil];
@@ -381,6 +386,8 @@ -(void)fillNotesInKeySignatureDictionary{
seventyFiveNoteNum, seventyThreeNoteNum, seventyOneNoteNum, seventyNoteNum, sixtyEightNoteNum, sixtySixNoteNum,
sixtyFourNoteNum, sixtyThreeNoteNum, sixtyOneNoteNum, fiftyNineNoteNum, fiftyEightNoteNum, nil];
+ */
+
NSArray *GflatMajor = [[NSArray alloc] initWithObjects:eightyTwoNoteNum, eightyNoteNum, seventyEightNoteNum, seventySevenNoteNum,
seventyFiveNoteNum, seventyThreeNoteNum, seventyOneNoteNum, seventyNoteNum, sixtyEightNoteNum, sixtySixNoteNum,
sixtyFiveNoteNum, sixtyThreeNoteNum, sixtyOneNoteNum, fiftyNineNoteNum, fiftyEightNoteNum, nil];
@@ -405,6 +412,7 @@ -(void)fillNotesInKeySignatureDictionary{
seventySixNoteNum, seventyFourNoteNum, seventyTwoNoteNum, seventyNoteNum, sixtyNineNoteNum, sixtySevenNoteNum,
sixtyFiveNoteNum, sixtyFourNoteNum, sixtyTwoNoteNum, sixtyNoteNum, fiftyEightNoteNum, nil];
+ /*
NSArray* AMinor = [[NSArray alloc] initWithObjects:eightyThreeNoteNum, eightyOneNoteNum, seventyNineNoteNum, seventySevenNoteNum,
@@ -466,15 +474,21 @@ -(void)fillNotesInKeySignatureDictionary{
NSArray *DMinor = [[NSArray alloc] initWithObjects:eightyTwoNoteNum, eightyOneNoteNum, seventyNineNoteNum, seventySevenNoteNum,
seventySixNoteNum, seventyFourNoteNum, seventyTwoNoteNum, seventyNoteNum, sixtyNineNoteNum, sixtySevenNoteNum,
sixtyFiveNoteNum, sixtyFourNoteNum, sixtyTwoNoteNum, sixtyNoteNum, fiftyEightNoteNum, nil];
+
+ CMajor, @"C/a", GMajor, @"G/e", DMajor, @"D/b", AMajor, @"A/f#", EMajor, @"E/c#",
+ BMajor, @"B/g#", FsharpMajor, @"F#/d#", DflatMajor, @"Db/bb", CflatMajor, @"Cb", GflatMajor, @"Gb/eb",
+ CsharpMajor, @"C#", AflatMajor, @"Ab/f", EflatMajor, @"Eb/c", BflatMajor, @"Bb/g", FMajor, @"F/d",
+ AMinor, @"Am", EMinor, @"Em", BMinor, @"Bm", FsharpMinor, @"F#m", CsharpMinor, @"C#m",
+ GsharpMinor, @"G#m", DsharpMinor, @"D#m", BflatMinor, @"Bbm", AflatMinor, @"Abm", EflatMinor, @"Ebm",
+ AsharpMinor, @"A#m", FMinor, @"Fm", CMinor, @"Cm", GMinor, @"Gm", DMinor, @"Dm", nil];
+
+ */
+
_keySignatureNoteMap = [[NSDictionary alloc] initWithObjectsAndKeys:
- CMajor, @"C", GMajor, @"G", DMajor, @"D", AMajor, @"A", EMajor, @"E",
- BMajor, @"B", FsharpMajor, @"F#", DflatMajor, @"Db", CflatMajor, @"Cb", GflatMajor, @"Gb",
- CsharpMajor, @"C#", AflatMajor, @"Ab", EflatMajor, @"Eb", BflatMajor, @"Bb", FMajor, @"F",
- AMinor, @"Am", EMinor, @"Em", BMinor, @"Bm", FsharpMinor, @"F#m", CsharpMinor, @"C#m",
- GsharpMinor, @"G#m", DsharpMinor, @"D#m", BflatMinor, @"Bbm", AflatMinor, @"Abm", EflatMinor, @"Ebm",
- AsharpMinor, @"A#m", FMinor, @"Fm", CMinor, @"Cm", GMinor, @"Gm", DMinor, @"Dm", nil];
+ GflatMajor, @"Gb/eb", DflatMajor, @"Db/bb", AflatMajor, @"Ab/f", EflatMajor, @"Eb/c", BflatMajor, @"Bb/g", FMajor, @"F/d",
+ CMajor, @"C/a", GMajor, @"G/e", DMajor, @"D/b", AMajor, @"A/f#", EMajor, @"E/c#", BMajor, @"B/g#", FsharpMajor, @"F#/d#", nil];
}
@@ -490,10 +504,10 @@ -(void) fillChordsDictionary{
NSNumber *fiveSharp = [[NSNumber alloc]initWithFloat:5.5];
NSNumber *fiveFlat = [[NSNumber alloc]initWithFloat:5.1];
NSNumber *six = [[NSNumber alloc]initWithFloat:6.0];
- NSNumber *sevenFlat = [[NSNumber alloc]initWithFloat:7.1];
+ // NSNumber *sevenFlat = [[NSNumber alloc]initWithFloat:7.1];
- //Chord *rest = [[Chord alloc] initWithName:@"rest" Notes:nil andID:0];
+ Chord *rest = [[Chord alloc] initWithName:@"rest" Notes:nil andID:0];
NSArray *a = [[NSArray alloc] initWithObjects:one, three, five, nil];
Chord *Maj = [[Chord alloc] initWithName:@"Maj" Notes:a andID:1];
@@ -516,11 +530,11 @@ -(void) fillChordsDictionary{
NSArray *g = [[NSArray alloc] initWithObjects:one, threeFlat, five, six, nil];
Chord *min6 = [[Chord alloc] initWithName:@"min6" Notes:g andID:7];
- NSArray *h = [[NSArray alloc] initWithObjects:one, three, five, sevenFlat, nil];
- Chord *dom7 = [[Chord alloc] initWithName:@"dom7" Notes:h andID:8];
+ //NSArray *h = [[NSArray alloc] initWithObjects:one, three, five, sevenFlat, nil];
+ //Chord *dom7 = [[Chord alloc] initWithName:@"dom7" Notes:h andID:8];
_majorKeyChords = [[NSArray alloc]initWithObjects:Maj, min, aug, dim, sus4, Maj6,
- min6, dom7, nil];
+ min6, rest, nil];
}
// tell each Chord in the array what to concatenate its
@@ -566,7 +580,6 @@ -(void)newChordVolumeAdjustment:(float)newValue{
-(void)playNoteAt:(int)position WithHalfStepAlteration:(int) accidentalState{
int noteNumber = [[_currentKeySignatureNotes objectAtIndex:position] intValue];
- NSLog(@"Playing note %d", noteNumber);
// add -1 or 1 to flat or sharp the note if the user wanted
if(accidentalState){
noteNumber += accidentalState;
@@ -579,7 +592,6 @@ -(void)playNoteAt:(int)position WithHalfStepAlteration:(int) accidentalState{
// tell MIDI channel 2 to play note 65
-(void)metronomeTick{
- NSLog(@"Tick");
AppDelegate *appDelegate = (AppDelegate *)[[UIApplication sharedApplication]delegate];
appDelegate._api->setChannelMessage (appDelegate.handle, 0x00, 0x91, 65, 40);
}
@@ -614,7 +626,6 @@ -(void) chordInstrumentWasChosen:(int)instrument{
}
-(void)stopNote{
- NSLog(@"Stopped playing note");
AppDelegate *appDelegate = (AppDelegate *)[[UIApplication sharedApplication]delegate];
appDelegate._api->setChannelMessage (appDelegate.handle, 0x00, 0x80, currentNote, 100);
}
@@ -625,12 +636,11 @@ -(void)playChord:(Chord *)chord
[currentChord setKey:chord.key];
AppDelegate *appDelegate = (AppDelegate *)[[UIApplication sharedApplication]delegate];
- NSLog(@"Chord key: %@", chord.key);
+// NSLog(@"Chord key: %@", chord.key);
for (int x=0; x<currentChord.notes.count; x++) {
int note = [self calculateMajorNoteForChord:currentChord atPosition:x];
if(note != 0){
- // velocity between 0-127
appDelegate._api->setChannelMessage (appDelegate.handle, 0x00, 146 + x, note, 42 + [_chordVolumeAddition intValue]);
}
}
@@ -640,8 +650,8 @@ -(int)calculateMajorNoteForChord:(Chord*)chord atPosition:(int) pos{
int note = 0;
// get the starting note for this key
- int startingLocation = [[[_keySignatureAccidentals objectForKey:_currentKey] objectAtIndex:0] intValue] - 1;
- NSLog(@"root note: %d", startingLocation);
+ int startingLocation = [[[_keySignatureAccidentals objectForKey:currentChord.key] objectAtIndex:0] intValue] - 1;
+ //NSLog(@"root note: %d", startingLocation);
float value = [[chord.notes objectAtIndex:pos] floatValue];
@@ -687,7 +697,6 @@ -(int)calculateMajorNoteForChord:(Chord*)chord atPosition:(int) pos{
-(void)stopChord:(Chord *)chord
{
- NSLog(@"Stop chord:%@", chord.name);
AppDelegate *appDelegate = (AppDelegate *)[[UIApplication sharedApplication]delegate];
for (int x=0; x<chord.notes.count; x++) {
int note = [self calculateMajorNoteForChord:chord atPosition:x];
View
21 Staff/StaffController.m
@@ -288,14 +288,14 @@ - (void)setSpaceTags
- (BOOL)changeScale:(NSArray *)notesFromDataController
{
//Return false if array is not normalized properly
- if(notesFromDataController.count != NUMBER_OF_NOTES + 1){
+ if(notesFromDataController.count != NUMBER_OF_NOTES){
NSLog(@" Recieved this number of notes: %@", [notesFromDataController count]);
return FALSE;
}
//Parse values for validity first
int num = -1;
- for(int i = 1; i <= NUMBER_OF_NOTES; i++)
+ for(int i = 0; i < NUMBER_OF_NOTES; i++)
{
num = [[notesFromDataController objectAtIndex:i] integerValue];
if(num != -1 && num != 0 && num != 1){
@@ -311,14 +311,13 @@ - (BOOL)changeScale:(NSArray *)notesFromDataController
num = -1;
//For each, display flat/sharp if value -1/1
- for(int pos = 1; pos <= NUMBER_OF_NOTES; pos++)
+ for(int pos = 0; pos < NUMBER_OF_NOTES; pos++)
{
- NSLog(@"note value: %d",[[notesFromDataController objectAtIndex:pos] intValue]);
num = [[notesFromDataController objectAtIndex:pos] intValue];
if(num != 0){
- //Add +1 to pos becase tag attributes of lines/spaces start at 1
- [self setFlatOrSharpOnSpecificLineOrSpace:num withNotePosition:pos+1];
- [self findAccidentalNote:pos+1];
+ NSLog(@"value: %d pos: %d",[[notesFromDataController objectAtIndex:pos] intValue], pos);
+ [self setFlatOrSharpOnSpecificLineOrSpace:num withNotePosition:pos + 2];
+ [self findAccidentalNote:pos + 2];
}
}
return TRUE;
@@ -441,19 +440,19 @@ - (void)setFlatsAndSharps
- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
{
- NSLog(@"# of Touches: %d",[touches count]);
+ //NSLog(@"# of Touches: %d",[touches count]);
NSArray *allTouches = [touches allObjects];
AppDelegate *mainDelegate = (AppDelegate*)[[UIApplication sharedApplication]delegate];
for (UITouch *touch in allTouches)
{
if(touch.view.tag > 0){
- NSLog(@"Began - Tag: %d",touch.view.tag);
+ // NSLog(@"Began - Tag: %d",touch.view.tag);
[mainDelegate.viewController.dataController playNoteAt:(touch.view.tag - 1) WithHalfStepAlteration:0];
}
else if(touch.view.superview.tag > 0){
- NSLog(@"Began - Tag: %d",touch.view.tag);
- NSLog(@"state: %d",mainDelegate.viewController.accidentalsController.state);
+ // NSLog(@"Began - Tag: %d",touch.view.tag);
+ // NSLog(@"state: %d",mainDelegate.viewController.accidentalsController.state);
[mainDelegate.viewController.dataController playNoteAt:(touch.view.superview.tag - 1) WithHalfStepAlteration:mainDelegate.viewController.accidentalsController.state];
}
}

0 comments on commit cf67dca

Please sign in to comment.