internal void CreateNodes() { Space = HalfSpace * 2; int pc = 0; int y = 0; int ypos = HalfSpace; XYPC.Clear(); DictXYPC.Clear(); //* initialize PC and DictPC int xpos = HalfSpace; while (ypos < picPC.Height - HalfSpace) { List <clsXYPC> listx = new List <clsXYPC>(); int x = 0; while (xpos < picPC.Width - HalfSpace) { clsXYPC xypc = new clsXYPC(x, y, xpos, ypos, pc); listx.Add(xypc); x++; xpos += Space; pc = (pc + 7).Mod12(); //circle of fifths if (!DictXYPC.ContainsKey(pc)) { DictXYPC.Add(pc, xypc); } } XYPC.Add(listx); x = 0; if (y % 2 == 0) { xpos = Space; pc = (listx[0].PC + 3).Mod12(); //minor sixth } else { xpos = HalfSpace; //starting position pc = (listx[0].PC + 8).Mod12(); //minor third } y++; ypos += Space; } //* set key Key = (P.F.MTime == null) ? new clsKey(0, "major", 0) : P.F.Keys[P.F.CurrentBBT.Ticks]; bool[] scalenotes = (Key.Major) ? NoteName.MajScaleNotes : NoteName.MinScaleNotesDown; ScaleNotes = new bool[12]; for (int i = 0; i < 12; i++) { ScaleNotes[(i + Key.KBTrans_KeyNote).Mod12()] = scalenotes[i]; } picPC.Refresh(); }
private void picPC_Paint(object sender, PaintEventArgs e) { Graphics xgr = e.Graphics; xgr.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.AntiAlias; SizeF size = new SizeF(Diameter, Diameter); Key = (P.F.MTime == null) ? new clsKey(0, "major", 0) : P.F.Keys[P.F.CurrentBBT.Ticks]; //* show nodes ShowNodes(xgr, size); //* check if bullseyes should be shown if (nudLookAhead.Value > 0 && P.F.CF != null) { ShowBullsEyes(xgr, size); } //* drawstring solfa or note ShowNames(xgr, size); //* show chords ShowChords(); }