Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Included Tempo Events from MIDI #2

Open
wants to merge 16 commits into
base: master
Choose a base branch
from

Conversation

Daniferous
Copy link

Experimented in Importing Tempo Events from MIDIs.

Tempo Events are designated as MIDI Note 128 since MIDIs only allow notes 0 to 127. The designation can be changed in the future.

Experimented in Importing Tempo Events from MIDIs.

Tempo Events are designated as MIDI Note 128 since MIDIs only allow notes 0 to 127. The designation can be changed in the future.
Added option to choose Conversion Method. There are three current methods:
1. Original K9ShyGuy MIDI Convert
2. ScratchPFA legacy (similar to the original format but with track headers)
3. Optimized ScratchPFA (converts MIDI to use a fixed resolution of 96 PPQ (384 pulses per whole note)
1. Removed older conversion mode for Eden's PFA.
2. Now added channel support (for drums)
3. Will probably tinker with program changes (and control changes?) soon
Still tinkering with NAudio Library to make MIDI CC magic happen. May or may not be implemented.
Note Velocity is now directly influenced by both Volume and Expression Control Changes. This ensures that this update will still make newly converted MIDIs compatible with Newer Eden MIDI Player and ScratchPFA, but is not guaranteed. Sustain CC is planned but highly unlikely to be developed and most likely to be removed.
@FlynnD273
Copy link
Owner

Just checking, you're not doing anything with the tempo change events yet? Are you planning on implementing those on Scratch's side? Or in the parser? I think if you do it in the parser it'll be compatible with my project, though it'll be a bit more math.

@Daniferous
Copy link
Author

Just checking, you're not doing anything with the tempo change events yet? Are you planning on implementing those on Scratch's side? Or in the parser? I think if you do it in the parser it'll be compatible with my project, though it'll be a bit more math.

In short: Tempo is parsed into an event in the parser, but needs to be filtered in the Scratch Project.

I kind of implemented tempo events weirdly. I assigned it a note event "pitch" value of 128, given that MIDIs usually have a note range from 0 to 127. This means that tempo processing is done on the parser itself. As for Scratch, I made a filter that detects if the note pitch is 128 so that it will be treated differently apart from the others.

@FlynnD273
Copy link
Owner

Sounds good. My project doesn't play notes over 127, so it should just work. Did you see the other comments I made on the rest of the code?

Daniferous and others added 7 commits June 29, 2023 06:03
Added Conversion to Aranara MIDI File Format.
Function AranaraN allows addition of note, tempo, track marker, and patch change events.
AraMIDI inclusion caused exportTPQN to be doubled for better quality, but forgot to ensure that only AraMIDI only has that doubled TPQN.

Release EXE file is at the Publish Folder
Published EXE seemed to not show up in the file repository.
Exported files in the Debug Folder were actually from the Release Folder. Added Debug Folder to gitignore.
Now only supports Aranara MIDI File Format Conversion.
@FlynnD273
Copy link
Owner

Hi, so I think that this belongs in its own fork, since this breaks compatibility with the original Scratch project. So I think it's appropriate to keep the two projects separate.

Channel 16 converted to Channel 1 due to an oversight in channel data analysis... Added a header to distinguish between Aranara MIDI files.
Same channel issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants