Skip to content

Commit

Permalink
Final bug fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
arduano committed Jun 20, 2019
1 parent c620b9c commit 6ea4978
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 2 deletions.
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "MIDIModificationFramework"]
path = MIDIModificationFramework
url = https://github.com/arduano/MIDIModificationFramework.git
6 changes: 6 additions & 0 deletions ImageToMidi/ConversionProcess.cs
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,12 @@ public void WriteMidi(string filename, int ticksPerPixel, int ppq, int startOffs
writer.WriteFormat(1);
writer.WritePPQ((ushort)ppq);
writer.WriteNtrks((ushort)tracks);

//writer.InitTrack();
//writer.Write(new TimeSignatureEvent(0, 4, 2, 24, 8));
//writer.Write(new TempoEvent(0, 500000));
//writer.EndTrack();

for (int i = 0; i < tracks; i++)
{
writer.InitTrack();
Expand Down
8 changes: 6 additions & 2 deletions ImageToMidi/ZoomableImage.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -365,8 +365,12 @@ protected override Freezable CreateInstanceCore()
return instance;
}

double easeFunc(double x, double v) => (-2 + 4 * x + v * (1 + 2 * x * (1 + x * (-5 - 2 * (x - 3) * x)))) / (4 + 8 * (x - 1) * x);
double easeVelFunc(double x, double v) => -((x - 1) * (2 * x + v * (x - 1) * (-1 + 4 * x * (1 + (x - 1) * x)))) / Math.Pow(1 + 2 * (x - 1) * x, 2);
double easeFunc(double x, double v) =>
(-2 + 4 * x + v * (1 + 2 * x * (1 + x * (-5 - 2 * (x - 3) * x)))) /
(4 + 8 * (x - 1) * x);
double easeVelFunc(double x, double v) =>
-((x - 1) * (2 * x + v * (x - 1) * (-1 + 4 * x * (1 + (x - 1) * x)))) /
Math.Pow(1 + 2 * (x - 1) * x, 2);

protected override double GetCurrentValueCore(double defaultOriginValue, double defaultDestinationValue, AnimationClock animationClock)
{
Expand Down
1 change: 1 addition & 0 deletions MIDIModificationFramework

0 comments on commit 6ea4978

Please sign in to comment.