Browse Source

Finally identify what every note is for real!

main
Starbeamrainbowlabs 3 years ago
parent
commit
eeb11e1bf7
Signed by: sbrl GPG Key ID: 1BE5172E637709C2
  1. 51
      MusicBoxConverter/MusicBox.cs
  2. 5
      MusicBoxConverter/MusicBoxScoreGenerator.cs
  3. 17
      MusicBoxConverter/Program.cs

51
MusicBoxConverter/MusicBox.cs

@ -62,6 +62,57 @@ namespace MusicBoxConverter
//return string.Format("[MusicBox: Name={0}, ValidNotes={1}]", Name, ValidNotes);
}
/*
* Real Life Music Box Printed
*
*
* Middle C4 G
* D4 A
* E4 B
* F4 C
* G4 D
* A5 E
*
* A#5 F
* B5 F#
* C G
* D A
*
*
*
*
* F#3
* G3
* C4
* D4
* E4
* F4
* G4
* A5
* A#5
* B5
* C5
* C#5
* D5
* D#5
* E5
* F5
* F#5
* G5
* G#5
* A6
* A#6
* B6
* C6
* C#6
* D6
* D#6
* E6
* F6
* G6
* A7
*/
/// <summary>
/// A 30 note music box.
/// @Starbeamrainbowlabs has one of these - it was the part of the

5
MusicBoxConverter/MusicBoxScoreGenerator.cs

@ -72,12 +72,13 @@ namespace MusicBoxConverter
);
svg.UnitSuffix = "mm";
for(float i = 0; i < area.Y; i += ScaleFactor.Y)
{
// Draw the note lines
for(float i = 0; i < area.Y; i += ScaleFactor.Y) {
Vector2 start = Offset.Add(new Vector2(0, i));
svg.WriteLine(start, start.Add(new Vector2(area.X, 0)), "darkgreen", 0.75f);
}
// Draw a red box around everything
svg.WriteRectangle(Offset, area, "red", 0.75f);
foreach(Note note in AllNotes())

17
MusicBoxConverter/Program.cs

@ -1,5 +1,5 @@
using System;
using System.Reflection;
using Melanchall.DryWetMidi.Common;
using SBRL.Utilities;
@ -13,6 +13,7 @@ namespace MusicBoxConverter
string inputFilename = "";
string outputFilename = "";
bool debug = false;
MusicBox targetMusicBox = MusicBox.Note30;
for(int i = 0; i < args.Length; i++)
{
@ -39,6 +40,15 @@ namespace MusicBoxConverter
debug = true;
break;
case "--box":
targetMusicBox = (MusicBox)typeof(MusicBox).GetField(
args[++i],
BindingFlags.GetField |
BindingFlags.Static |
BindingFlags.Public
).GetValue(null);
break;
case "-h":
case "--help":
Console.Error.WriteLine(EmbeddedFiles.ReadAllText("MusicBoxConverter.Help.txt"));
@ -62,8 +72,9 @@ namespace MusicBoxConverter
MusicBoxScoreGenerator converter = new MusicBoxScoreGenerator(
inputFilename,
MusicBox.Note30
);
converter.Debug = debug;
) {
Debug = debug
};
converter.Output(outputFilename);
return 0;

Loading…
Cancel
Save