Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

latest

  • Loading branch information...
commit cf67dca67804177c62b951f660a122729c47d059 2 parents 8e90339 + 22fdb3c
cnharris authored
60 Staff.xcodeproj/project.pbxproj
@@ -52,12 +52,14 @@
52 52 A717FEDF1534ED9D00515250 /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A717FEDE1534ED9D00515250 /* CoreFoundation.framework */; };
53 53 A717FEE21534EE1300515250 /* Security.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A717FEE11534EE1300515250 /* Security.framework */; };
54 54 A732C771154F6E3100EE6845 /* CircleOfFifthsViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = A732C770154F6E3100EE6845 /* CircleOfFifthsViewController.m */; };
55   - A74531581552388200BF3E43 /* crsynth.dlsc in Resources */ = {isa = PBXBuildFile; fileRef = A74531511552388200BF3E43 /* crsynth.dlsc */; };
56   - A74531591552388200BF3E43 /* libcrmpd.a in Frameworks */ = {isa = PBXBuildFile; fileRef = A74531531552388200BF3E43 /* libcrmpd.a */; };
57   - A745315A1552388200BF3E43 /* libcrse.a in Frameworks */ = {isa = PBXBuildFile; fileRef = A74531541552388200BF3E43 /* libcrse.a */; };
58   - A745315B1552388200BF3E43 /* libcrmpd.a in Frameworks */ = {isa = PBXBuildFile; fileRef = A74531561552388200BF3E43 /* libcrmpd.a */; };
59   - A745315C1552388200BF3E43 /* libcrse.a in Frameworks */ = {isa = PBXBuildFile; fileRef = A74531571552388200BF3E43 /* libcrse.a */; };
60 55 A765348B15276051001885E9 /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A765348A15276051001885E9 /* AudioToolbox.framework */; };
  56 + A785F7801553096400191D36 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A785F77F1553096400191D36 /* QuartzCore.framework */; };
  57 + A785F78715530EB400191D36 /* CircleView.m in Sources */ = {isa = PBXBuildFile; fileRef = A785F78615530EB400191D36 /* CircleView.m */; };
  58 + A785F78A1553244F00191D36 /* crsynth.dlsc in Resources */ = {isa = PBXBuildFile; fileRef = A785F7891553244F00191D36 /* crsynth.dlsc */; };
  59 + A785F7911553245B00191D36 /* libcrmpd.a in Frameworks */ = {isa = PBXBuildFile; fileRef = A785F78C1553245B00191D36 /* libcrmpd.a */; };
  60 + A785F7921553245B00191D36 /* libcrse.a in Frameworks */ = {isa = PBXBuildFile; fileRef = A785F78D1553245B00191D36 /* libcrse.a */; };
  61 + A785F7931553245B00191D36 /* libcrmpd.a in Frameworks */ = {isa = PBXBuildFile; fileRef = A785F78F1553245B00191D36 /* libcrmpd.a */; };
  62 + A785F7941553245B00191D36 /* libcrse.a in Frameworks */ = {isa = PBXBuildFile; fileRef = A785F7901553245B00191D36 /* libcrse.a */; };
61 63 A7A180C4154EF70600712D92 /* solidVerticalLine.m in Sources */ = {isa = PBXBuildFile; fileRef = A7A180C3154EF70600712D92 /* solidVerticalLine.m */; };
62 64 /* End PBXBuildFile section */
63 65
@@ -130,13 +132,16 @@
130 132 A717FEE11534EE1300515250 /* Security.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Security.framework; path = System/Library/Frameworks/Security.framework; sourceTree = SDKROOT; };
131 133 A732C76F154F6E3100EE6845 /* CircleOfFifthsViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CircleOfFifthsViewController.h; sourceTree = "<group>"; };
132 134 A732C770154F6E3100EE6845 /* CircleOfFifthsViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CircleOfFifthsViewController.m; sourceTree = "<group>"; };
133   - A74531501552388200BF3E43 /* crmd.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = crmd.h; sourceTree = "<group>"; };
134   - A74531511552388200BF3E43 /* crsynth.dlsc */ = {isa = PBXFileReference; lastKnownFileType = file; path = crsynth.dlsc; sourceTree = "<group>"; };
135   - A74531531552388200BF3E43 /* libcrmpd.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libcrmpd.a; sourceTree = "<group>"; };
136   - A74531541552388200BF3E43 /* libcrse.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libcrse.a; sourceTree = "<group>"; };
137   - A74531561552388200BF3E43 /* libcrmpd.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libcrmpd.a; sourceTree = "<group>"; };
138   - A74531571552388200BF3E43 /* libcrse.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libcrse.a; sourceTree = "<group>"; };
139 135 A765348A15276051001885E9 /* AudioToolbox.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AudioToolbox.framework; path = System/Library/Frameworks/AudioToolbox.framework; sourceTree = SDKROOT; };
  136 + A785F77F1553096400191D36 /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; };
  137 + A785F78515530EB400191D36 /* CircleView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CircleView.h; sourceTree = "<group>"; };
  138 + A785F78615530EB400191D36 /* CircleView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CircleView.m; sourceTree = "<group>"; };
  139 + A785F7881553244F00191D36 /* crmd.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = crmd.h; sourceTree = "<group>"; };
  140 + A785F7891553244F00191D36 /* crsynth.dlsc */ = {isa = PBXFileReference; lastKnownFileType = file; path = crsynth.dlsc; sourceTree = "<group>"; };
  141 + A785F78C1553245B00191D36 /* libcrmpd.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libcrmpd.a; sourceTree = "<group>"; };
  142 + A785F78D1553245B00191D36 /* libcrse.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libcrse.a; sourceTree = "<group>"; };
  143 + A785F78F1553245B00191D36 /* libcrmpd.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libcrmpd.a; sourceTree = "<group>"; };
  144 + A785F7901553245B00191D36 /* libcrse.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libcrse.a; sourceTree = "<group>"; };
140 145 A7A180C2154EF70600712D92 /* solidVerticalLine.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = solidVerticalLine.h; sourceTree = "<group>"; };
141 146 A7A180C3154EF70600712D92 /* solidVerticalLine.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = solidVerticalLine.m; sourceTree = "<group>"; };
142 147 /* End PBXFileReference section */
@@ -146,6 +151,7 @@
146 151 isa = PBXFrameworksBuildPhase;
147 152 buildActionMask = 2147483647;
148 153 files = (
  154 + A785F7801553096400191D36 /* QuartzCore.framework in Frameworks */,
149 155 A717FEE21534EE1300515250 /* Security.framework in Frameworks */,
150 156 A717FEDF1534ED9D00515250 /* CoreFoundation.framework in Frameworks */,
151 157 A765348B15276051001885E9 /* AudioToolbox.framework in Frameworks */,
@@ -216,6 +222,7 @@
216 222 2AE1DE7215154B72008C538D /* Frameworks */ = {
217 223 isa = PBXGroup;
218 224 children = (
  225 + A785F77F1553096400191D36 /* QuartzCore.framework */,
219 226 A717FEE11534EE1300515250 /* Security.framework */,
220 227 A717FEDE1534ED9D00515250 /* CoreFoundation.framework */,
221 228 A765348A15276051001885E9 /* AudioToolbox.framework */,
@@ -256,6 +263,8 @@
256 263 0826BDD01523E5C2004A9B22 /* StaffController.m */,
257 264 2A94A4DE1542622000766EAF /* AccidentalsController.h */,
258 265 2A94A4DF1542622000766EAF /* AccidentalsController.m */,
  266 + A785F78515530EB400191D36 /* CircleView.h */,
  267 + A785F78615530EB400191D36 /* CircleView.m */,
259 268 A732C76F154F6E3100EE6845 /* CircleOfFifthsViewController.h */,
260 269 A732C770154F6E3100EE6845 /* CircleOfFifthsViewController.m */,
261 270 2AB9BF68154795C9001E756E /* InstrumentsController.h */,
@@ -296,33 +305,33 @@
296 305 name = "Supporting Files";
297 306 sourceTree = "<group>";
298 307 };
299   - A74531521552388200BF3E43 /* Release-iphoneos */ = {
  308 + A76534921527B777001885E9 /* crsynth */ = {
300 309 isa = PBXGroup;
301 310 children = (
302   - A74531531552388200BF3E43 /* libcrmpd.a */,
303   - A74531541552388200BF3E43 /* libcrse.a */,
  311 + A785F78B1553245B00191D36 /* Release-iphoneos */,
  312 + A785F78E1553245B00191D36 /* Release-iphonesimulator */,
  313 + A785F7881553244F00191D36 /* crmd.h */,
  314 + A785F7891553244F00191D36 /* crsynth.dlsc */,
304 315 );
305   - path = "Release-iphoneos";
  316 + path = crsynth;
306 317 sourceTree = "<group>";
307 318 };
308   - A74531551552388200BF3E43 /* Release-iphonesimulator */ = {
  319 + A785F78B1553245B00191D36 /* Release-iphoneos */ = {
309 320 isa = PBXGroup;
310 321 children = (
311   - A74531561552388200BF3E43 /* libcrmpd.a */,
312   - A74531571552388200BF3E43 /* libcrse.a */,
  322 + A785F78C1553245B00191D36 /* libcrmpd.a */,
  323 + A785F78D1553245B00191D36 /* libcrse.a */,
313 324 );
314   - path = "Release-iphonesimulator";
  325 + path = "Release-iphoneos";
315 326 sourceTree = "<group>";
316 327 };
317   - A76534921527B777001885E9 /* crsynth */ = {
  328 + A785F78E1553245B00191D36 /* Release-iphonesimulator */ = {
318 329 isa = PBXGroup;
319 330 children = (
320   - A74531501552388200BF3E43 /* crmd.h */,
321   - A74531511552388200BF3E43 /* crsynth.dlsc */,
322   - A74531521552388200BF3E43 /* Release-iphoneos */,
323   - A74531551552388200BF3E43 /* Release-iphonesimulator */,
  331 + A785F78F1553245B00191D36 /* libcrmpd.a */,
  332 + A785F7901553245B00191D36 /* libcrse.a */,
324 333 );
325   - path = crsynth;
  334 + path = "Release-iphonesimulator";
326 335 sourceTree = "<group>";
327 336 };
328 337 /* End PBXGroup section */
@@ -422,6 +431,7 @@
422 431 A732C771154F6E3100EE6845 /* CircleOfFifthsViewController.m in Sources */,
423 432 A705B21B154F9A980010D0B3 /* ChordInstrumentsController.m in Sources */,
424 433 08C9512A1550CB0A00D44C3E /* Circleof5thsController.m in Sources */,
  434 + A785F78715530EB400191D36 /* CircleView.m in Sources */,
425 435 );
426 436 runOnlyForDeploymentPostprocessing = 0;
427 437 };
BIN  Staff.xcodeproj/project.xcworkspace/xcuserdata/aarontietz.xcuserdatad/UserInterfaceState.xcuserstate
Binary file not shown
BIN  Staff.xcodeproj/project.xcworkspace/xcuserdata/christopherharris.xcuserdatad/UserInterfaceState.xcuserstate
Binary file not shown
2  Staff/ChordViewController.h
@@ -131,4 +131,6 @@
131 131 -(void) chordChosen_onTouchUpInside:(id)sender;
132 132 -(UIView *) deepCopySolidVerticalLine:(solidVerticalLine *)theView;
133 133
  134 +- (IBAction)openCircleOfFifthsMenu:(id)sender;
  135 +
134 136 @end
3  Staff/ChordViewController.m
@@ -152,7 +152,6 @@ - (UIView *)deepCopySolidVerticalLine:(solidVerticalLine *)theView
152 152
153 153 - (IBAction)openInstrumentsMenu:(id)sender
154 154 {
155   -// AppDelegate *mainDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
156 155 if([instumentPopoverController isPopoverVisible]){
157 156 [instumentPopoverController dismissPopoverAnimated:YES];
158 157 return;
@@ -164,6 +163,7 @@ - (IBAction)openInstrumentsMenu:(id)sender
164 163 }
165 164
166 165 -(IBAction)openCircleOfFifthsMenu:(id)sender{
  166 +
167 167 if([circleOfFifthsPopoverController isPopoverVisible]){
168 168 [circleOfFifthsPopoverController dismissPopoverAnimated:YES];
169 169 return;
@@ -174,7 +174,6 @@ -(IBAction)openCircleOfFifthsMenu:(id)sender{
174 174 [circleOfFifthsPopoverController setPopoverContentSize:CGSizeMake(510, 510)];
175 175 }
176 176
177   -
178 177 -(void) layoutChordPickers
179 178 {
180 179 // Coordinates are relative to the parent container
2  Staff/CircleOfFifthsViewController.h
@@ -7,6 +7,8 @@
7 7 //
8 8
9 9 #import <UIKit/UIKit.h>
  10 +#import "CircleView.h"
  11 +
10 12
11 13 @interface CircleOfFifthsViewController : UIViewController
12 14
27 Staff/CircleOfFifthsViewController.m
@@ -5,25 +5,36 @@
5 5 // Created by Aaron Tietz on 4/30/12.
6 6 // Copyright (c) 2012 Tufts University. All rights reserved.
7 7 //
8   -
9 8 #import "CircleOfFifthsViewController.h"
10 9
11   -@interface CircleOfFifthsViewController ()
12   -
13   -@end
14   -
15 10 @implementation CircleOfFifthsViewController
16 11
17 12 @synthesize content = _content;
18 13
  14 +-(id)init{
  15 + self = [super init];
  16 + if (self){
  17 + _content = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 500, 500)];
  18 + [_content setBackgroundColor:[UIColor whiteColor]];
  19 + [_content addSubview:[self deepCopyCircleView:_content]];
  20 + }
  21 + return self;
  22 +}
  23 +
19 24 - (void)viewDidLoad
20 25 {
21 26 [super viewDidLoad];
22   - _content = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 500, 500)];
23   - [_content setBackgroundColor:[UIColor blackColor]];
24   -
25 27 }
26 28
  29 +- (UIView *)deepCopyCircleView:(UIView *)theView
  30 +{
  31 + CircleView *newView = [[CircleView alloc] initWithFrame:[theView frame]];
  32 + [newView setBackgroundColor:[UIColor lightGrayColor]];
  33 + [newView setAlpha:0.5f];
  34 + return newView;
  35 +}
  36 +
  37 +
27 38 -(void) touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event{
28 39 NSArray *allTouches = [touches allObjects];
29 40 for(UITouch* t in allTouches){
13 Staff/CircleView.h
... ... @@ -0,0 +1,13 @@
  1 +//
  2 +// CircleView.h
  3 +// Staff
  4 +//
  5 +// Created by Aaron Tietz on 5/3/12.
  6 +// Copyright (c) 2012 Tufts University. All rights reserved.
  7 +//
  8 +
  9 +#import <UIKit/UIKit.h>
  10 +
  11 +@interface CircleView : UIView
  12 +
  13 +@end
39 Staff/CircleView.m
... ... @@ -0,0 +1,39 @@
  1 +//
  2 +// CircleView.m
  3 +// Staff
  4 +//
  5 +// Created by Aaron Tietz on 5/3/12.
  6 +// Copyright (c) 2012 Tufts University. All rights reserved.
  7 +//
  8 +
  9 +#import "CircleView.h"
  10 +
  11 +@implementation CircleView
  12 +
  13 +- (id)initWithFrame:(CGRect)frame
  14 +{
  15 + self = [super initWithFrame:frame];
  16 + if (self) {
  17 + self.backgroundColor = [UIColor whiteColor];
  18 + [self drawRect:frame];
  19 + }
  20 + return self;
  21 +}
  22 +
  23 +
  24 +- (void)drawRect:(CGRect)rect
  25 +{
  26 + CGContextRef context = UIGraphicsGetCurrentContext();
  27 +
  28 + CGContextSetLineWidth(context, 2.0);
  29 +
  30 + CGContextSetStrokeColorWithColor(context, [UIColor blueColor].CGColor);
  31 +
  32 + CGRect rectangle = CGRectMake(0,0,500,500);
  33 +
  34 + CGContextAddEllipseInRect(context, rectangle);
  35 +
  36 + CGContextStrokePath(context);}
  37 +
  38 +
  39 +@end
3  Staff/Circleof5thsController.m
@@ -38,7 +38,8 @@ - (void)setup
38 38 {
39 39 AppDelegate *mainDelegate = (AppDelegate*)[[UIApplication sharedApplication]delegate];
40 40 circleOf5thsPickerElements = [[NSArray alloc]
41   - initWithObjects:@"F#",@"B",@"E",@"A",@"D",@"G",@"C",@"F",@"Bb",@"Eb",@"Ab",@"Db",@"Gb", nil];
  41 + initWithObjects:@"Gb/eb", @"Db/bb", @"Ab/f", @"Eb/c", @"Bb/g", @"F/d", @"C/a", @"G/e",
  42 + @"D/b", @"A/f#", @"E/c#", @"B/g#", @"F#/d#", nil];
42 43
43 44 // CHANGED THE SECOND PARAMETER TO 100 FROM 200
44 45 circleOf5thsView = [[UIView alloc] initWithFrame:CGRectMake(577, 250, 260, 250)];
143 Staff/DataController.m
@@ -36,7 +36,7 @@ -(BOOL) loadData{
36 36 }
37 37
38 38 // Initialize key signature choice to C
39   - [self setCurrentKeySignature:@"C"];
  39 + [self setCurrentKeySignature:@"C/a"];
40 40 [self keySignatureWasChosen:_currentKeySignature];
41 41
42 42 // Initialize staff and chord instruments to piano
@@ -64,6 +64,7 @@ -(void)fillKeySignatureAccidentals{
64 64 NSNumber *none = [[NSNumber alloc] initWithInt:0];
65 65 NSNumber *sharp = [[NSNumber alloc] initWithInt:1];
66 66
  67 + /*
67 68 NSNumber *B3 = [[NSNumber alloc] initWithInt:15];
68 69 NSNumber *C4 = [[NSNumber alloc] initWithInt:14];
69 70 NSNumber *D4 = [[NSNumber alloc] initWithInt:13];
@@ -71,6 +72,7 @@ -(void)fillKeySignatureAccidentals{
71 72 NSNumber *F4 = [[NSNumber alloc] initWithInt:11];
72 73 NSNumber *G4 = [[NSNumber alloc] initWithInt:10];
73 74 NSNumber *A4 = [[NSNumber alloc] initWithInt:9];
  75 + */
74 76
75 77 // Create arrays for all keySignatures in the Circle of 5ths, where 1 is the first b
76 78 // above the treble clef and 15 the first b below 0 is a none note
@@ -78,112 +80,112 @@ -(void)fillKeySignatureAccidentals{
78 80
79 81 /** all natural notes **/
80 82
81   - NSArray *CMajor = [[NSArray alloc] initWithObjects:C4,
  83 + NSArray *CMajor = [[NSArray alloc] initWithObjects:
82 84 none,none,none,none,
83 85 none,none,none,none,
84 86 none,none,none,none,
85 87 none,none,none,nil];
86   -
  88 + /*
87 89 NSArray *AMinor = [[NSArray alloc] initWithObjects:A4,
88 90 none,none,none,none,
89 91 none,none,none,none,
90 92 none,none,none,none,
91 93 none,none,none,nil];
92   -
  94 + */
93 95
94 96 /** b: B **/
95 97
96   - NSArray *FMajor = [[NSArray alloc] initWithObjects:F4,
  98 + NSArray *FMajor = [[NSArray alloc] initWithObjects:
97 99 none,none,none,none,
98 100 none,none,none,flat,
99 101 none,none,none,none,
100 102 none,none,none,nil];
101   -
  103 + /*
102 104 NSArray *DMinor = [[NSArray alloc] initWithObjects:D4,
103 105 none,none,none,none,
104 106 none,none,none,flat,
105 107 none,none,none,none,
106 108 none,none,none,nil];
107   -
  109 + */
108 110
109 111 /** b: B, E **/
110 112
111   - NSArray *BflatMajor = [[NSArray alloc] initWithObjects:B3,
  113 + NSArray *BflatMajor = [[NSArray alloc] initWithObjects:
112 114 none,none,none,none,
113 115 flat,none,none,flat,
114 116 none,none,none,none,
115 117 none,none,none,nil];
116   -
  118 + /*
117 119 NSArray *GMinor = [[NSArray alloc] initWithObjects:G4,
118 120 none,none,none,none,
119 121 flat,none,none,flat,
120 122 none,none,none,none,
121 123 none,none,none,nil];
122   -
  124 + */
123 125
124 126 /** b: A, B, E **/
125 127
126   - NSArray *EflatMajor = [[NSArray alloc] initWithObjects:E4,
  128 + NSArray *EflatMajor = [[NSArray alloc] initWithObjects:
127 129 none,none,none,none,
128 130 flat,none,none,flat,
129 131 flat,none,none,none,
130 132 none,none,none,nil];
131 133
132   -
  134 + /*
133 135 NSArray *CMinor = [[NSArray alloc] initWithObjects:C4,
134 136 none,none,none,none,
135 137 flat,none,none,flat,
136 138 flat,none,none,none,
137 139 none,none,none,nil];
138   -
  140 + */
139 141
140 142 /** b: A, B, D, E **/
141 143
142   - NSArray *AflatMajor = [[NSArray alloc] initWithObjects:A4,
  144 + NSArray *AflatMajor = [[NSArray alloc] initWithObjects:
143 145 none,none,none,none,
144 146 flat,flat,none,flat,
145 147 flat,none,none,none,
146 148 none,none,none,nil];
147   -
  149 + /*
148 150 NSArray *FMinor = [[NSArray alloc] initWithObjects:F4,
149 151 none,none,none,none,
150 152 flat,flat,none,flat,
151 153 flat,none,none,none,
152 154 none,none,none,nil];
153   -
  155 + */
154 156
155 157 /** b: A, B, D, E, G **/
156 158
157   - NSArray *DflatMajor = [[NSArray alloc] initWithObjects:D4,
  159 + NSArray *DflatMajor = [[NSArray alloc] initWithObjects:
158 160 none,none,none,none,
159 161 flat,flat,none,flat,
160 162 flat,flat,none,none,
161 163 none,none,none,nil];
162   -
  164 + /*
163 165 NSArray *BflatMinor = [[NSArray alloc] initWithObjects:B3,
164 166 none,none,none,none,
165 167 flat,flat,none,flat,
166 168 flat,flat,none,none,
167 169 none,none,none,nil];
168   -
  170 + */
169 171
170 172 /** b: A, B, C, D, E, G **/
171 173
172   - NSArray *GflatMajor = [[NSArray alloc] initWithObjects:G4,
  174 + NSArray *GflatMajor = [[NSArray alloc] initWithObjects:
173 175 none,none,none,none,
174 176 flat,flat,flat,flat,
175 177 flat,flat,none,none,
176 178 none,none,none,nil];
177   -
  179 + /*
178 180 NSArray *EflatMinor = [[NSArray alloc] initWithObjects:E4,
179 181 none,none,none,none,
180 182 flat,flat,flat,flat,
181 183 flat,flat,none,none,
182 184 none,none,none,nil];
183   -
  185 + */
184 186
185 187 /** b: A, B, C, D, E, G, F **/
186   -
  188 + /*
187 189 NSArray *CflatMajor = [[NSArray alloc] initWithObjects:C4,
188 190 none,none,none,none,
189 191 flat,flat,flat,flat,
@@ -195,99 +197,104 @@ -(void)fillKeySignatureAccidentals{
195 197 flat,flat,flat,flat,
196 198 flat,flat,flat,none,
197 199 none,none,none,nil];
198   -
  200 + */
199 201
200 202 /** #: F **/
201 203
202   - NSArray *GMajor = [[NSArray alloc] initWithObjects:G4,
  204 + NSArray *GMajor = [[NSArray alloc] initWithObjects:
203 205 none,none,none,sharp,
204 206 none,none,none,none,
205 207 none,none,none,none,
206 208 none,none,none,nil];
207   -
  209 + /*
208 210 NSArray *EMinor = [[NSArray alloc] initWithObjects:E4,
209 211 none,none,none,sharp,
210 212 none,none,none,none,
211 213 none,none,none,none,
212 214 none,none,none,nil];
213   -
  215 + */
214 216
215 217 /** #: C, F **/
216 218
217   - NSArray *DMajor = [[NSArray alloc] initWithObjects:D4,
  219 + NSArray *DMajor = [[NSArray alloc] initWithObjects:
218 220 none,none,none,sharp,
219 221 none,none,sharp,none,
220 222 none,none,none,none,
221 223 none,none,none,nil];
222   -
  224 + /*
223 225 NSArray *BMinor = [[NSArray alloc] initWithObjects:B3,
224 226 none,none,none,sharp,
225 227 none,none,sharp,none,
226 228 none,none,none,none,
227 229 none,none,none,nil];
228   -
  230 + */
229 231
230 232 /** #: C, F, G **/
231 233
232   - NSArray *AMajor = [[NSArray alloc] initWithObjects:A4,
  234 + NSArray *AMajor = [[NSArray alloc] initWithObjects:
233 235 none,none,sharp,sharp,
234 236 none,none,sharp,none,
235 237 none,none,none,none,
236 238 none,none,none,nil];
237   -
  239 + /*
238 240 NSArray *FsharpMinor = [[NSArray alloc] initWithObjects:F4,
239 241 none,none,sharp,sharp,
240 242 none,none,sharp,none,
241 243 none,none,none,none,
242 244 none,none,none,nil];
243   -
  245 + */
244 246
245 247 /** #: C, D, F, G **/
246 248
247   - NSArray *EMajor = [[NSArray alloc] initWithObjects:E4,
  249 + NSArray *EMajor = [[NSArray alloc] initWithObjects:
248 250 none,none,sharp,sharp,
249 251 none,sharp,sharp,none,
250 252 none,none,none,none,
251 253 none,none,none,nil];
252   -
  254 + /*
253 255 NSArray *CsharpMinor = [[NSArray alloc] initWithObjects:C4,
254 256 none,none,sharp,sharp,
255 257 none,sharp,sharp,none,
256 258 none,none,none,none,
257 259 none,none,none,nil];
258   -
  260 + */
259 261
260 262 /** #: A, C, D, F, G **/
261 263
262   - NSArray *BMajor = [[NSArray alloc] initWithObjects:B3,
  264 + NSArray *BMajor = [[NSArray alloc] initWithObjects:
263 265 none,none,sharp,sharp,
264 266 none,sharp,sharp,none,
265 267 sharp,none,none,none,
266 268 none,none,none,nil];
267   -
  269 + /*
268 270 NSArray *GsharpMinor = [[NSArray alloc] initWithObjects:G4,
269 271 none,none,sharp,sharp,
270 272 none,sharp,sharp,none,
271 273 sharp,none,none,none,
272 274 none,none,none,nil];
  275 + */
273 276
274 277
275 278 /** #: A, C, D, E, F, G **/
276 279
277   - NSArray *FsharpMajor = [[NSArray alloc] initWithObjects:F4,
  280 + NSArray *FsharpMajor = [[NSArray alloc] initWithObjects:
278 281 none,none,sharp,sharp,
279 282 sharp,sharp,sharp,none,
280 283 sharp,none,none,none,
281 284 none,none,none,nil];
282   -
  285 +
  286 + /*
283 287 NSArray *DsharpMinor = [[NSArray alloc] initWithObjects:D4,
284 288 none,none,sharp,sharp,
285 289 sharp,sharp,sharp,none,
286 290 sharp,none,none,none,
287 291 none,none,none,nil];
  292 + */
288 293
289 294 /** #: A, B, C, D, E, F, G **/
290 295
  296 + /*
  297 +
291 298 NSArray *CsharpMajor = [[NSArray alloc] initWithObjects:C4,
292 299 none,none,sharp,sharp,
293 300 sharp,sharp,sharp,sharp,
@@ -299,15 +306,12 @@ -(void)fillKeySignatureAccidentals{
299 306 sharp,sharp,sharp,sharp,
300 307 sharp,none,none,none,
301 308 none,none,none,nil];
  309 + */
302 310
303 311 // Fill the keySignatures dictionary with each array and their corresponding key (to be the same as in the circle of fifths picker)
304 312 _keySignatureAccidentals = [[NSDictionary alloc] initWithObjectsAndKeys:
305   - CMajor, @"C", GMajor, @"G", DMajor, @"D", AMajor, @"A", EMajor, @"E",
306   - BMajor, @"B", FsharpMajor, @"F#", CsharpMajor, @"C#", CflatMajor, @"Cb", GflatMajor, @"Gb",
307   - DflatMajor, @"Db", AflatMajor, @"Ab", EflatMajor, @"Eb", BflatMajor, @"Bb", FMajor, @"F",
308   - AMinor, @"Am", EMinor, @"Em", BMinor, @"Bm", FsharpMinor, @"F#m", CsharpMinor, @"C#m",
309   - GsharpMinor, @"G#m", DsharpMinor, @"D# Minor", AsharpMinor, @"A#m", AflatMinor, @"Abm", EflatMinor, @"Ebm",
310   - BflatMinor, @"Bbm", FMinor, @"Fm", CMinor, @"Cm", GMinor, @"Gm", DMinor, @"Dm", nil];
  313 + GflatMajor, @"Gb/eb", DflatMajor, @"Db/bb", AflatMajor, @"Ab/f", EflatMajor, @"Eb/c", BflatMajor, @"Bb/g", FMajor, @"F/d",
  314 + CMajor, @"C/a", GMajor, @"G/e", DMajor, @"D/b", AMajor, @"A/f#", EMajor, @"E/c#", BMajor, @"B/g#", FsharpMajor, @"F#/d#", nil];
311 315
312 316 }
313 317
@@ -342,7 +346,7 @@ -(void)fillNotesInKeySignatureDictionary{
342 346 NSNumber *eightyOneNoteNum = [[NSNumber alloc] initWithInt:81];
343 347 NSNumber *eightyTwoNoteNum = [[NSNumber alloc] initWithInt:82];
344 348 NSNumber *eightyThreeNoteNum = [[NSNumber alloc] initWithInt:83];
345   - NSNumber *eightyFourNoteNum = [[NSNumber alloc] initWithInt:84];
  349 +// NSNumber *eightyFourNoteNum = [[NSNumber alloc] initWithInt:84];
346 350
347 351
348 352 NSArray *CMajor = [[NSArray alloc] initWithObjects:eightyThreeNoteNum, eightyOneNoteNum, seventyNineNoteNum, seventySevenNoteNum,
@@ -372,7 +376,8 @@ -(void)fillNotesInKeySignatureDictionary{
372 376 NSArray *FsharpMajor = [[NSArray alloc] initWithObjects:eightyThreeNoteNum, eightyTwoNoteNum, eightyNoteNum, seventyEightNoteNum,
373 377 seventySevenNoteNum, seventyFiveNoteNum, seventyThreeNoteNum, seventyOneNoteNum, seventyNoteNum, sixtyEightNoteNum,
374 378 sixtySixNoteNum, sixtyFiveNoteNum, sixtyThreeNoteNum, sixtyOneNoteNum, fiftyNineNoteNum, nil];
375   -
  379 +
  380 + /*
376 381 NSArray *CsharpMajor = [[NSArray alloc] initWithObjects:eightyFourNoteNum, eightyTwoNoteNum, eightyNoteNum, seventyEightNoteNum,
377 382 seventySevenNoteNum, seventyFiveNoteNum, seventyThreeNoteNum, seventyTwoNoteNum, seventyNoteNum, sixtyEightNoteNum,
378 383 sixtySixNoteNum, sixtyFiveNoteNum, sixtyThreeNoteNum, sixtyOneNoteNum, sixtyNoteNum, nil];
@@ -381,6 +386,8 @@ -(void)fillNotesInKeySignatureDictionary{
381 386 seventyFiveNoteNum, seventyThreeNoteNum, seventyOneNoteNum, seventyNoteNum, sixtyEightNoteNum, sixtySixNoteNum,
382 387 sixtyFourNoteNum, sixtyThreeNoteNum, sixtyOneNoteNum, fiftyNineNoteNum, fiftyEightNoteNum, nil];
383 388
  389 + */
  390 +
384 391 NSArray *GflatMajor = [[NSArray alloc] initWithObjects:eightyTwoNoteNum, eightyNoteNum, seventyEightNoteNum, seventySevenNoteNum,
385 392 seventyFiveNoteNum, seventyThreeNoteNum, seventyOneNoteNum, seventyNoteNum, sixtyEightNoteNum, sixtySixNoteNum,
386 393 sixtyFiveNoteNum, sixtyThreeNoteNum, sixtyOneNoteNum, fiftyNineNoteNum, fiftyEightNoteNum, nil];
@@ -405,6 +412,7 @@ -(void)fillNotesInKeySignatureDictionary{
405 412 seventySixNoteNum, seventyFourNoteNum, seventyTwoNoteNum, seventyNoteNum, sixtyNineNoteNum, sixtySevenNoteNum,
406 413 sixtyFiveNoteNum, sixtyFourNoteNum, sixtyTwoNoteNum, sixtyNoteNum, fiftyEightNoteNum, nil];
407 414
  415 + /*
408 416
409 417
410 418 NSArray* AMinor = [[NSArray alloc] initWithObjects:eightyThreeNoteNum, eightyOneNoteNum, seventyNineNoteNum, seventySevenNoteNum,
@@ -466,15 +474,21 @@ -(void)fillNotesInKeySignatureDictionary{
466 474 NSArray *DMinor = [[NSArray alloc] initWithObjects:eightyTwoNoteNum, eightyOneNoteNum, seventyNineNoteNum, seventySevenNoteNum,
467 475 seventySixNoteNum, seventyFourNoteNum, seventyTwoNoteNum, seventyNoteNum, sixtyNineNoteNum, sixtySevenNoteNum,
468 476 sixtyFiveNoteNum, sixtyFourNoteNum, sixtyTwoNoteNum, sixtyNoteNum, fiftyEightNoteNum, nil];
  477 +
  478 + CMajor, @"C/a", GMajor, @"G/e", DMajor, @"D/b", AMajor, @"A/f#", EMajor, @"E/c#",
  479 + BMajor, @"B/g#", FsharpMajor, @"F#/d#", DflatMajor, @"Db/bb", CflatMajor, @"Cb", GflatMajor, @"Gb/eb",
  480 + CsharpMajor, @"C#", AflatMajor, @"Ab/f", EflatMajor, @"Eb/c", BflatMajor, @"Bb/g", FMajor, @"F/d",
  481 + AMinor, @"Am", EMinor, @"Em", BMinor, @"Bm", FsharpMinor, @"F#m", CsharpMinor, @"C#m",
  482 + GsharpMinor, @"G#m", DsharpMinor, @"D#m", BflatMinor, @"Bbm", AflatMinor, @"Abm", EflatMinor, @"Ebm",
  483 + AsharpMinor, @"A#m", FMinor, @"Fm", CMinor, @"Cm", GMinor, @"Gm", DMinor, @"Dm", nil];
  484 +
  485 + */
  486 +
469 487
470 488
471 489 _keySignatureNoteMap = [[NSDictionary alloc] initWithObjectsAndKeys:
472   - CMajor, @"C", GMajor, @"G", DMajor, @"D", AMajor, @"A", EMajor, @"E",
473   - BMajor, @"B", FsharpMajor, @"F#", DflatMajor, @"Db", CflatMajor, @"Cb", GflatMajor, @"Gb",
474   - CsharpMajor, @"C#", AflatMajor, @"Ab", EflatMajor, @"Eb", BflatMajor, @"Bb", FMajor, @"F",
475   - AMinor, @"Am", EMinor, @"Em", BMinor, @"Bm", FsharpMinor, @"F#m", CsharpMinor, @"C#m",
476   - GsharpMinor, @"G#m", DsharpMinor, @"D#m", BflatMinor, @"Bbm", AflatMinor, @"Abm", EflatMinor, @"Ebm",
477   - AsharpMinor, @"A#m", FMinor, @"Fm", CMinor, @"Cm", GMinor, @"Gm", DMinor, @"Dm", nil];
  490 + GflatMajor, @"Gb/eb", DflatMajor, @"Db/bb", AflatMajor, @"Ab/f", EflatMajor, @"Eb/c", BflatMajor, @"Bb/g", FMajor, @"F/d",
  491 + CMajor, @"C/a", GMajor, @"G/e", DMajor, @"D/b", AMajor, @"A/f#", EMajor, @"E/c#", BMajor, @"B/g#", FsharpMajor, @"F#/d#", nil];
478 492
479 493 }
480 494
@@ -490,10 +504,10 @@ -(void) fillChordsDictionary{
490 504 NSNumber *fiveSharp = [[NSNumber alloc]initWithFloat:5.5];
491 505 NSNumber *fiveFlat = [[NSNumber alloc]initWithFloat:5.1];
492 506 NSNumber *six = [[NSNumber alloc]initWithFloat:6.0];
493   - NSNumber *sevenFlat = [[NSNumber alloc]initWithFloat:7.1];
  507 + // NSNumber *sevenFlat = [[NSNumber alloc]initWithFloat:7.1];
494 508
495 509
496   - //Chord *rest = [[Chord alloc] initWithName:@"rest" Notes:nil andID:0];
  510 + Chord *rest = [[Chord alloc] initWithName:@"rest" Notes:nil andID:0];
497 511
498 512 NSArray *a = [[NSArray alloc] initWithObjects:one, three, five, nil];
499 513 Chord *Maj = [[Chord alloc] initWithName:@"Maj" Notes:a andID:1];
@@ -516,11 +530,11 @@ -(void) fillChordsDictionary{
516 530 NSArray *g = [[NSArray alloc] initWithObjects:one, threeFlat, five, six, nil];
517 531 Chord *min6 = [[Chord alloc] initWithName:@"min6" Notes:g andID:7];
518 532
519   - NSArray *h = [[NSArray alloc] initWithObjects:one, three, five, sevenFlat, nil];
520   - Chord *dom7 = [[Chord alloc] initWithName:@"dom7" Notes:h andID:8];
  533 + //NSArray *h = [[NSArray alloc] initWithObjects:one, three, five, sevenFlat, nil];
  534 + //Chord *dom7 = [[Chord alloc] initWithName:@"dom7" Notes:h andID:8];
521 535
522 536 _majorKeyChords = [[NSArray alloc]initWithObjects:Maj, min, aug, dim, sus4, Maj6,
523   - min6, dom7, nil];
  537 + min6, rest, nil];
524 538 }
525 539
526 540 // tell each Chord in the array what to concatenate its
@@ -566,7 +580,6 @@ -(void)newChordVolumeAdjustment:(float)newValue{
566 580 -(void)playNoteAt:(int)position WithHalfStepAlteration:(int) accidentalState{
567 581
568 582 int noteNumber = [[_currentKeySignatureNotes objectAtIndex:position] intValue];
569   - NSLog(@"Playing note %d", noteNumber);
570 583 // add -1 or 1 to flat or sharp the note if the user wanted
571 584 if(accidentalState){
572 585 noteNumber += accidentalState;
@@ -579,7 +592,6 @@ -(void)playNoteAt:(int)position WithHalfStepAlteration:(int) accidentalState{
579 592
580 593 // tell MIDI channel 2 to play note 65
581 594 -(void)metronomeTick{
582   - NSLog(@"Tick");
583 595 AppDelegate *appDelegate = (AppDelegate *)[[UIApplication sharedApplication]delegate];
584 596 appDelegate._api->setChannelMessage (appDelegate.handle, 0x00, 0x91, 65, 40);
585 597 }
@@ -614,7 +626,6 @@ -(void) chordInstrumentWasChosen:(int)instrument{
614 626 }
615 627
616 628 -(void)stopNote{
617   - NSLog(@"Stopped playing note");
618 629 AppDelegate *appDelegate = (AppDelegate *)[[UIApplication sharedApplication]delegate];
619 630 appDelegate._api->setChannelMessage (appDelegate.handle, 0x00, 0x80, currentNote, 100);
620 631 }
@@ -625,12 +636,11 @@ -(void)playChord:(Chord *)chord
625 636 [currentChord setKey:chord.key];
626 637
627 638 AppDelegate *appDelegate = (AppDelegate *)[[UIApplication sharedApplication]delegate];
628   - NSLog(@"Chord key: %@", chord.key);
  639 +// NSLog(@"Chord key: %@", chord.key);
629 640
630 641 for (int x=0; x<currentChord.notes.count; x++) {
631 642 int note = [self calculateMajorNoteForChord:currentChord atPosition:x];
632 643 if(note != 0){
633   - // velocity between 0-127
634 644 appDelegate._api->setChannelMessage (appDelegate.handle, 0x00, 146 + x, note, 42 + [_chordVolumeAddition intValue]);
635 645 }
636 646 }
@@ -640,8 +650,8 @@ -(int)calculateMajorNoteForChord:(Chord*)chord atPosition:(int) pos{
640 650 int note = 0;
641 651
642 652 // get the starting note for this key
643   - int startingLocation = [[[_keySignatureAccidentals objectForKey:_currentKey] objectAtIndex:0] intValue] - 1;
644   - NSLog(@"root note: %d", startingLocation);
  653 + int startingLocation = [[[_keySignatureAccidentals objectForKey:currentChord.key] objectAtIndex:0] intValue] - 1;
  654 + //NSLog(@"root note: %d", startingLocation);
645 655
646 656 float value = [[chord.notes objectAtIndex:pos] floatValue];
647 657
@@ -687,7 +697,6 @@ -(int)calculateMajorNoteForChord:(Chord*)chord atPosition:(int) pos{
687 697
688 698 -(void)stopChord:(Chord *)chord
689 699 {
690   - NSLog(@"Stop chord:%@", chord.name);
691 700 AppDelegate *appDelegate = (AppDelegate *)[[UIApplication sharedApplication]delegate];
692 701 for (int x=0; x<chord.notes.count; x++) {
693 702 int note = [self calculateMajorNoteForChord:chord atPosition:x];
21 Staff/StaffController.m
@@ -288,14 +288,14 @@ - (void)setSpaceTags
288 288 - (BOOL)changeScale:(NSArray *)notesFromDataController
289 289 {
290 290 //Return false if array is not normalized properly
291   - if(notesFromDataController.count != NUMBER_OF_NOTES + 1){
  291 + if(notesFromDataController.count != NUMBER_OF_NOTES){
292 292 NSLog(@" Recieved this number of notes: %@", [notesFromDataController count]);
293 293 return FALSE;
294 294 }
295 295
296 296 //Parse values for validity first
297 297 int num = -1;
298   - for(int i = 1; i <= NUMBER_OF_NOTES; i++)
  298 + for(int i = 0; i < NUMBER_OF_NOTES; i++)
299 299 {
300 300 num = [[notesFromDataController objectAtIndex:i] integerValue];
301 301 if(num != -1 && num != 0 && num != 1){
@@ -311,14 +311,13 @@ - (BOOL)changeScale:(NSArray *)notesFromDataController
311 311 num = -1;
312 312
313 313 //For each, display flat/sharp if value -1/1
314   - for(int pos = 1; pos <= NUMBER_OF_NOTES; pos++)
  314 + for(int pos = 0; pos < NUMBER_OF_NOTES; pos++)
315 315 {
316   - NSLog(@"note value: %d",[[notesFromDataController objectAtIndex:pos] intValue]);
317 316 num = [[notesFromDataController objectAtIndex:pos] intValue];
318 317 if(num != 0){
319   - //Add +1 to pos becase tag attributes of lines/spaces start at 1
320   - [self setFlatOrSharpOnSpecificLineOrSpace:num withNotePosition:pos+1];
321   - [self findAccidentalNote:pos+1];
  318 + NSLog(@"value: %d pos: %d",[[notesFromDataController objectAtIndex:pos] intValue], pos);
  319 + [self setFlatOrSharpOnSpecificLineOrSpace:num withNotePosition:pos + 2];
  320 + [self findAccidentalNote:pos + 2];
322 321 }
323 322 }
324 323 return TRUE;
@@ -441,19 +440,19 @@ - (void)setFlatsAndSharps
441 440
442 441 - (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
443 442 {
444   - NSLog(@"# of Touches: %d",[touches count]);
  443 + //NSLog(@"# of Touches: %d",[touches count]);
445 444 NSArray *allTouches = [touches allObjects];
446 445 AppDelegate *mainDelegate = (AppDelegate*)[[UIApplication sharedApplication]delegate];
447 446 for (UITouch *touch in allTouches)
448 447 {
449 448 if(touch.view.tag > 0){
450   - NSLog(@"Began - Tag: %d",touch.view.tag);
  449 + // NSLog(@"Began - Tag: %d",touch.view.tag);
451 450 [mainDelegate.viewController.dataController playNoteAt:(touch.view.tag - 1) WithHalfStepAlteration:0];
452 451
453 452 }
454 453 else if(touch.view.superview.tag > 0){
455   - NSLog(@"Began - Tag: %d",touch.view.tag);
456   - NSLog(@"state: %d",mainDelegate.viewController.accidentalsController.state);
  454 + // NSLog(@"Began - Tag: %d",touch.view.tag);
  455 + // NSLog(@"state: %d",mainDelegate.viewController.accidentalsController.state);
457 456 [mainDelegate.viewController.dataController playNoteAt:(touch.view.superview.tag - 1) WithHalfStepAlteration:mainDelegate.viewController.accidentalsController.state];
458 457 }
459 458 }

0 comments on commit cf67dca

Please sign in to comment.
Something went wrong with that request. Please try again.