MIDI NES
-
- Posts: 22
- Joined: Tue Mar 16, 2021 11:29 pm
- Has thanked: 3 times
- Been thanked: 3 times
MIDI NES
-
- Posts: 22
- Joined: Tue Mar 16, 2021 11:29 pm
- Has thanked: 3 times
- Been thanked: 3 times
Re: MIDI NES
-
- Posts: 22
- Joined: Tue Mar 16, 2021 11:29 pm
- Has thanked: 3 times
- Been thanked: 3 times
Re: MIDI NES
I'm not a programmer and I have no idea if utilizing the available open source resources could result in a custom rom that would allow midi control over the NES core, it's all guessing for me but it seems like there's a possibility this can be done.https://github.com/MiSTer-devel/NES_MiS ... 50eb8d7431
I added a conversion from USB MIDI to the NES controller. It worked with both an original Miracle Piano and a Yamaha MIDI keyboard which I tested with a cheapo USB MIDI adapter (I've heard they can be built cheaply and possibly dangerously to use with some hardware; use at your own risk).
I haven't tried it in months, and it's possible it's broken by the recent overhaul to MIDI/serial communications. But builds back before the recent changes absolutely worked. The setup for the MiSTer_Main was identical to (for example) what was needed for Amiga (I also tried the Amiga version of the Miracle Piano software connected the same way).
The key addition needed is the NES header. It needs to have the Default Expansion Device set to MIracle Piano (byte 0xF=15 be set to 0x19=25):
http://wiki.nesdev.com/w/index.php/NES_ ... ion_Device
https://github.com/MiSTer-devel/NES_MiS ... S.sv#L1277
-
- Posts: 22
- Joined: Tue Mar 16, 2021 11:29 pm
- Has thanked: 3 times
- Been thanked: 3 times
Re: MIDI NES
Chip-Maestro https://github.com/jareklupinski/chip-maestro
There's a couple other projects on his Github that may be of use like this Raspberry Pi hat that lets you control the NES sound hardware directly
NES-Forever https://github.com/jareklupinski/nes-forever
He even created a standalone NES synth
Standalone-NES-Synth https://github.com/jareklupinski/standalone-nes-synth
-
- Posts: 22
- Joined: Tue Mar 16, 2021 11:29 pm
- Has thanked: 3 times
- Been thanked: 3 times
Re: MIDI NES
Nessy http://forums.nesdev.com/viewtopic.php?f=6&t=17839
-
- Posts: 22
- Joined: Tue Mar 16, 2021 11:29 pm
- Has thanked: 3 times
- Been thanked: 3 times
Re: MIDI NES
Here's the Mega Drive Midi Interface Project
https://github.com/rhargreaves/mega-dri ... -interface
and here is the Hairless Midi to Serial Bridge Program
https://projectgus.github.io/hairless-midiserial/
- meauxdal
- Posts: 140
- Joined: Mon Nov 23, 2020 3:28 am
- Location: atlanta
- Has thanked: 33 times
- Been thanked: 103 times
- Contact:
Re: MIDI NES
-
- Posts: 22
- Joined: Tue Mar 16, 2021 11:29 pm
- Has thanked: 3 times
- Been thanked: 3 times
Re: MIDI NES
Yes! I think some of the people using old console sound chips to make music would quickly become users of the MiSTer. Just imagine being able to control all of the different consoles sound chips through midi without having to buy all the extras just to make it happen on original hardware, plus clean digital output. I know many people love the sound of the SID chip from the C64, Gameboy is another one, lots of people using that to make music. I'm going to try an experiment with the Genesis core. I ordered a genMDM from Catskull Electronics and I was going to use it with my Mega SG but I'm going to try it on the MiSTer with the Genesis SNAC adapter. I'm curious to see if it will work. As soon as I try it out I'll post up my results here.meauxdal wrote: ↑Thu Apr 01, 2021 4:52 pm I'm very interested in these sorts of applications myself. Edit: I see you've linked most of what I was looking at sharing, lol. I'll just reiterate that I'm very interested in the results of this stuff. I've played around with using MIDI in the computer cores, but using the console sound chips is exciting too.
- Kitrinx
- Core Developer
- Posts: 185
- Joined: Sat May 23, 2020 2:14 am
- Location: NYC
- Has thanked: 1 time
- Been thanked: 147 times
- Contact:
Re: MIDI NES
-
- Posts: 96
- Joined: Thu Jun 04, 2020 9:01 pm
- Has thanked: 16 times
- Been thanked: 19 times
Re: MIDI NES
dont have any midi so cant test it out.
Re: MIDI NES
https://www.youtube.com/watch?v=kSvDvj6Li9M
-
- Posts: 96
- Joined: Thu Jun 04, 2020 9:01 pm
- Has thanked: 16 times
- Been thanked: 19 times
Re: MIDI NES
[greyrogue 2022-02-21 8878755]
NSF/MIDI phase complete (#297)
-All expansion audio visualizers working
-MIDI can now switch between controlling APU Pulse/Triangle split, APU Pulse, APU Triangle, MMC5 Pulse and MMC5 Pulse/APU Triangle split with C0 (patch commands)
-- If patch bit 6 ($40-$7F), APU Triangle only and uses normal octaves.
-- If patch bit 3 ($8). Then behaves like below, but uses MMC5 pulses in place of APU pulses
-- If patch bit 2 ($4). Then only pulses used. If not set, triangle is used at G#3 and is up one octave. iei G3->G4 for the triangle.
-- Patch bits 0 and 1 ($0-$03) set the pulse duty cycle.
-
- Posts: 96
- Joined: Thu Jun 04, 2020 9:01 pm
- Has thanked: 16 times
- Been thanked: 19 times
-
- Posts: 237
- Joined: Sun May 24, 2020 10:06 pm
- Has thanked: 115 times
- Been thanked: 68 times
Re: MIDI NES
Or does this require some custom hardware MIDI interface plugged into the user port on the I/O board?
Re: MIDI NES
Yes. I tested with a MIDI keyboard using a USB MIDI cable plugged into a standard USB port. Just set the UART mode to MIDI, MidiLink to USB, and open an NSF file (one that isn't continuous [e.g. sfx] if you only want your notes playing, otherwise it will be continuously playing over your notes). Avoid sending complex commands as the MIDI parser isn't super resilient. e.g. Sysex commands larger than the buffer (16 bytes) will likely break it. And NSF files that are actively using the sample channel while receiving MIDI data will likely corrupt the MIDI parser/buffer. You should see MIDI commands coming in (see the boxes in the pic showing note on/off commands [supports both 0x90 and 0x80] with note # [frequency] and volume), which is highlighting the two lines that show the 16 byte MIDI ring-buffer (starts overwriting the beginning when it reaches the end). If the two values in purple are ever mismatched (they should both be pointing to the next spot to put new MIDI data - in the pic they are pointing to the last value in the buffer 00, which hasn't been set yet), the MIDI parser has likely confused itself. Load a new NSF to reset it. Only note on/off (with note # and volume) and patch commands (0xC0 with special values) are currently supported. The value in pink should show the current patch. Other commands should be skipped (but, again, the parser isn't particularly robust).
-- If patch bit 6 ($40-$7F), APU Triangle only and uses normal octaves.
-- If patch bit 3 ($8). Then behaves like below, but uses MMC5 pulses in place of APU pulses
-- If patch bit 2 ($4). Then only pulses used. If not set, triangle is used at G#3 and is up one octave. ie MIDI note G3-> will play as G4 for the triangle.
-- Patch bits 0 and 1 ($0-$03) set the pulse duty cycle.
SNAC using the I/O board with a Miracle Piano should also work, but is currently untested. As mentioned above, it isn't required.Or does this require some custom hardware MIDI interface plugged into the user port on the I/O board?
Re: MIDI NES
Re: MIDI NES
Yes it works. It requires the Miracle Piano nes file to have a NES 2.0 header, with the Miracle Piano option set in the controller byte.
https://www.nesdev.org/wiki/NES_2.0#Def ... ion_Device
The header I'm using for Miracle Piano looks like this:
4E 45 53 1A 10 08 10 08 00 00 07 00 00 00 00 19
The 0x19 at the end tells it to use the Miracle Piano.
If you're updating using the NES 2.0 database, it should have this line it, which should force the last byte to 25 = 0x19.
Code: Select all
<expansion type="25" />
If this isn't set, it won't work. Loading nsf files, forces this value to 0x19 to make those work.
I've tested this with a cheap Yamaha MIDI keyboard (YPT-210) and it "works". Note that the music is generated by the keyboard when using the Miracle Piano cart, and it was released before General MIDI standard instruments were defined, so it will use wrong instruments. When it's only trying to play default piano, it will be fine. However, for example, the demo song that plays on the second screen (shows a picture of the Miracle Piano keyboard) sounds awful because of wrong instruments, but is clearly trying to play music. This is especially noticeable for sound effects (ducks/applause/etc) and drums which don't line up at all. In theory, it should be possible to patch the ROMs to use different instruments, or build a translation table in the MIDI code in MiSTer to fix or at least improve this, but I haven't attempted it. Indeed, I don't think it would be all that hard to build a converter to use on an actual NES with a Yamaha keyboard with the same limitations/needed fixes. Something like an arduino or microcontroller just needs to parse the MIDI commands and replace some intelligently.
Anyway, the controls themselves work fine, though, and I completed some of the harder songs using it, including the broken ones. Read about broken songs and my initial messing around with Miracle Piano using FCEUX before I had a MiSTer here:
https://forums.nesdev.org/viewtopic.php ... 89#p214989
-
- Posts: 22
- Joined: Tue Mar 16, 2021 11:29 pm
- Has thanked: 3 times
- Been thanked: 3 times
Re: MIDI NES
I have a few MIDINES carts that I'm trying to dump the roms from but I'm having trouble because of the custom mapper they use. I did get a partial dump and was able to have the MIDINES screen display but that's all I was able to do. Also this is the first cart I've ever attempted to dump. I have two different hardware revisions of the MIDINES and the lastest revision 1.1.1 is using this custom squeedo board and mapper 124 from https://membler-industries.com/squeedo/2004_version/
I have limited experience when it comes to dumping carts so I'm assuming the custom mapper is the issue. I have a USB CopyNES and a Open Source Cartridge Reader, if anyone has the knowledge to help me get this cart dumped I would greatly appreciate it.
Can this mapper be implemented into the NES core? I'm assuming the MIDINES used the PIC microcontroller for processing incoming and outgoing midi data, so if midi is already implemented in the NES core would adding this mapper allow the rom to run like an NES with an MIDINES cart?
Imagine if we got MIDINES running on MiSTer. I'm hoping we can make this happen.
Re: MIDI NES
Hi, I designed and supplied those Squeedo boards used on some MIDINES revisions.
breakbeatscientist wrote: ↑Mon Apr 22, 2024 1:38 pmCan this mapper be implemented into the NES core? I'm assuming the MIDINES used the PIC microcontroller for processing incoming and outgoing midi data, so if midi is already implemented in the NES core would adding this mapper allow the rom to run like an NES with an MIDINES cart?
Yes, but not easily. You need to either:
A) Implement the PIC and run its program. One issue is that the MIDINES PIC is probably code protected, so it won't be dumped easily. I could ask if he wants to release it, maybe.
B) Reverse-engineer and reimplement what the PIC is doing. If I recall correctly, more of the logic in processing is done on the PIC side. Though I could be wrong. Just saying, it might not be so simple to recreate it.
Re: MIDI NES
Weird. I was just attempting to do the same with all of my console MIDI carts. I dumped the NES Famimimidi cart, but didn't get very far on the mister due to the mapper/PIC. I thought about just going the way of Chip Maestro since that's all open. Fingers crossed for MIDINES.
There must be something in the air, because just as I started thinking "midi functionality ought to be possible on console cores", GbMIDI_Mister was released, proving that it in fact could be done. I'm not sure how presets/samples would be created/saved/loaded, but one step at a time I suppose.