Sammy1Am / MoppyClassic

Moppy has been replaced with Moppy 2.0!
569 stars 190 forks source link

Double check defined note micro-periods #111

Closed solidsnake745 closed 8 years ago

solidsnake745 commented 8 years ago

I've been working on some stuff and needed the full range of note periods to try some stuff out. However in doing so I think I possibly found a bug with the periods, but I'm not entirely sure.

The micro-periods defined in MoppyPlayerOutput have a comment for each of the populated rows explaining which octave the notes belong to. The third row states it's the second octave (0 indexed).

image

I'd always just thought this was just human error when writing the comments, but when I calculated the periods myself I noticed it was off by one octave. So we've possibly been playing drives one octave lower than intended? Is that per design and intentional? Or are there other systems that define notes differently?

For my calculations I referenced two Wikipedia pages: https://en.wikipedia.org/wiki/Scientific_pitch_notation https://en.wikipedia.org/wiki/Piano_key_frequencies

With that I came up with the following spreadsheet for the micro-periods: https://docs.google.com/spreadsheets/d/1jNi_arrhXfX19zv5hv4yki_hOsP1rVKY8VlNhPOH6L0/edit?usp=sharing

If my spreadsheet is accurate, here is the updated array.

public static int[] microPeriods = {
        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
        30578, 28861, 27242, 25713, 24270, 22909, 21622, 20409, 19263, 18182, 17161, 16198, //C1 - B1
        15289, 14436, 13621, 12856, 12135, 11454, 10811, 10205, 9632, 9091, 8581, 8099, //C2 - B2
        7645, 7218, 6811, 6428, 6068, 5727, 5406, 5103, 4816, 4546, 4291, 4050, //C3 - B3
        3823, 3609, 3406, 3214, 3034, 2864, 2703, 2552, 2408, 2273, 2146, 2025, //C4 - B4
        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
    };

Thank you.

lpulley commented 8 years ago

You know...that could be an actual issue. At one point a couple of months ago, I set up my floppy system again, and certain drives would break on certain songs. I didn't understand why, since about half a year ago when I initially set it up, they worked fine. Maybe they were trying to play notes that were too high.

On Sun, Sep 20, 2015, 6:47 AM solidsnake745 notifications@github.com wrote:

I've working on some stuff and needed the full range of note periods to try some stuff out. However in doing so I think I possibly found a bug with the periods, but I'm not entirely sure.

The micro-periods defined in MoppyPlayerOutput have a comment for each of the populated rows explaining which octave the notes belong to. The third row states it's the second octave (0 indexed).

[image: image] https://cloud.githubusercontent.com/assets/1118404/9980453/c9fc84c4-5f68-11e5-9603-fc3f3cf75b57.png

I'd always just thought this was just human error when writing the comments, but when I calculated the periods myself I noticed it was off by one octave. So we've possibly been playing drives one octave lower than intended? Is that per design and intentional? Or are there other systems that define notes differently?

For my calculations I referenced two Wikipedia pages: https://en.wikipedia.org/wiki/Scientific_pitch_notation https://en.wikipedia.org/wiki/Piano_key_frequencies

With that I came up with the following spreadsheet for the micro-periods: https://docs.google.com/spreadsheets/d/1jNi_arrhXfX19zv5hv4yki_hOsP1rVKY8VlNhPOH6L0/edit?usp=sharing

If my spreadsheet is accurate, here is the updated array.

public static int[] microPeriods = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 30578, 28861, 27242, 25713, 24270, 22909, 21622, 20409, 19263, 18182, 17161, 16198, //C1 - B1 15289, 14436, 13621, 12856, 12135, 11454, 10811, 10205, 9632, 9091, 8581, 8099, //C2 - B2 7645, 7218, 6811, 6428, 6068, 5727, 5406, 5103, 4816, 4546, 4291, 4050, //C3 - B3 3823, 3609, 3406, 3214, 3034, 2864, 2703, 2552, 2408, 2273, 2146, 2025, //C4 - B4 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };

Thank you.

— Reply to this email directly or view it on GitHub https://github.com/SammyIAm/Moppy/issues/111.

solidsnake745 commented 8 years ago

But were they were still trying to play notes? If the notes were too high, then they wouldn't play anything at all since there are 0's at those positions.

The "problem" this would cause is just the wrong octave note being played. So for instance if you wanted to play C2, C1 is actually played. The notes defined are one octave lower than the position they are in is what I'm pointing out.

Also as far as I can remember, this array has never been changed since the conception of Moppy. Looking at the regular Moppy branch, it's the same there also. So I don't think this is the cause for the problem you're describing. Oh it seems Sam must have cleaned out that branch from his main repo. I still have it in my own fork though: https://github.com/solidsnake745/Moppy/blob/master/Java/MoppyDesk/src/moppydesk/MoppyPlayer.java.

lpulley commented 8 years ago

Huh. OK. Guess I still don't know why.

On Sun, Sep 20, 2015, 9:26 AM solidsnake745 notifications@github.com wrote:

But were they were still trying to play notes? If the notes were too high, then they wouldn't play anything at all since there are 0's at those positions.

The "problem" this would cause is just the wrong octave note being played. So for instance if you wanted to play C2, C1 is actually played. The notes defined are one octave lower than the position they are in is what I'm pointing out.

Also as far as I can remember, this array has never been changed since the conception of Moppy. Looking at the regular Moppy branch, it's the same there also. So I don't think this is the cause for the problem you're describing. Oh it seems Sam must have cleaned out that branch from his main repo. I still have it in my own fork though: https://github.com/solidsnake745/Moppy/blob/master/Java/MoppyDesk/src/moppydesk/MoppyPlayer.java .

— Reply to this email directly or view it on GitHub https://github.com/SammyIAm/Moppy/issues/111#issuecomment-141792328.

Sammy1Am commented 8 years ago

Hello there! I'm not dead, really! I'm so sorry I've been away so much lately; I really need to try to keep up with the GitHub/YouTube/Email messages.

The indexes of the periods are designed to correspond to the MIDI note number. That is, an A440 is MIDI note number 69. This is very much the standard, and I've been unable to find any examples of that not being the case. The array of microPeriods is absolutely correct (within a few microseconds here or there due to rounding errors).

The numbering of octaves, on the other hand, is not so concrete. Based on the naming scheme I chose (I've been using this page as a reference), that first row would indeed be called C-1.

The important thing in this case is the connection between MIDI note number (e.g. 69) and frequency (e.g. 440Hz) since that will affect the real sounds you hear produced by your drives, rather than anything to do with the arbitrary octave numbering systems.