PDA

View Full Version : Anyone did a simple 1 channel midi file import routine?



CuriousOne
- 31st January 2021, 15:47
Hello.
I'm making an LED clock for my daughter, and she wants for alarm tune to be "never gonna give you up", played in 1 channel beeper sound.
I have appropriate midi, and by looking into music editor, I can manually copy note heights, durations and pauses, but maybe there is some PBP friendly method, for converting midi sequence into sequence of data? like

110=C3, 111=C3#, 112=D3 and so on.

mpgmike
- 1st February 2021, 20:47
I have a project/product that uses tones generated with NCO. I created a generic #include file that lists the T2PR, T2CON, and NCO1INCU_H_L values for each note over 3 octaves. When I want a note, I call that subroutine. I then PAUSE for the note duration (have to run the math for 1/8, 1/4, 1/2, whole, etc.). Entire ditties are "canned" into a subroutine.

As for MIDI, I never worked with it. Nuts and Volts Magazine has featured several articles dealing with MIDI over the past couple years. I would assume you could equate a MIDI value to an NCO subroutine equivalent.

CuriousOne
- 2nd February 2021, 05:38
I have no issues with generating the sound, I'm having issues with automating it's import into PBP. In fact, I need more a PC software, which will parse midi file and convert it to byte sequence.