MIDI NES
-
- Posts: 23
- Joined: Tue Mar 16, 2021 11:29 pm
- Has thanked: 3 times
- Been thanked: 4 times
MIDI NES
-
- Posts: 23
- Joined: Tue Mar 16, 2021 11:29 pm
- Has thanked: 3 times
- Been thanked: 4 times
Re: MIDI NES
-
- Posts: 23
- Joined: Tue Mar 16, 2021 11:29 pm
- Has thanked: 3 times
- Been thanked: 4 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: 23
- Joined: Tue Mar 16, 2021 11:29 pm
- Has thanked: 3 times
- Been thanked: 4 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: 23
- Joined: Tue Mar 16, 2021 11:29 pm
- Has thanked: 3 times
- Been thanked: 4 times
Re: MIDI NES
Nessy http://forums.nesdev.com/viewtopic.php?f=6&t=17839
-
- Posts: 23
- Joined: Tue Mar 16, 2021 11:29 pm
- Has thanked: 3 times
- Been thanked: 4 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: 152
- Joined: Mon Nov 23, 2020 3:28 am
- Location: atlanta
- Has thanked: 39 times
- Been thanked: 126 times
- Contact:
Re: MIDI NES
-
- Posts: 23
- Joined: Tue Mar 16, 2021 11:29 pm
- Has thanked: 3 times
- Been thanked: 4 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: 187
- Joined: Sat May 23, 2020 2:14 am
- Location: NYC
- Has thanked: 1 time
- Been thanked: 149 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: 261
- Joined: Sun May 24, 2020 10:06 pm
- Has thanked: 136 times
- Been thanked: 78 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: 23
- Joined: Tue Mar 16, 2021 11:29 pm
- Has thanked: 3 times
- Been thanked: 4 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.
-
- Core Developer
- Posts: 5
- Joined: Sat Feb 24, 2024 7:51 pm
Re: MIDI NES
Hey! GBMidi dev here, and since this there's been an update with wav/noise added. Also there were already "patches" for the pulse channels, and now wav also has waves themselves. Anyway, I was researching some stuff while working on GenMidi (for genesis), and stumbled upon this convo so figured I'd say hello! I haven't been active on here, moreso on the discord, but happy to continue the convo wherever you'd like. But ya, just wanted to share those facts, and also that I will eventually make an NESMidi core as well, but not sure when. Almost wrapped up with V1 of GenMidi though so who knows?
Give me an idea of features you'd like in any of the above (and after testing yourself to see what's there vs what you'd want) and I'll see what I can do.
-
- Core Developer
- Posts: 5
- Joined: Sat Feb 24, 2024 7:51 pm
Re: MIDI NES
Oh yes and to be clear, with my cores I'm bypassing using a rom altogether (not a console rom anyway), in fact I'm not even using the consoles themselves, just the sound chip modules, and a separate module/CPU just for the visuals (simply because inputtest already existed in that form that I could easily retrofit for my purposes, which uses its own bootrom). So ya, basically midi data translated as directly as possible to the chips, very low latency, lots of capability. The only issue has been controls, which for GBMidi I opted for all within the OSD because it was easily integrated, for GenMidi, I've considered bringing more controls to the rom/CPU side, but not sure if I need to yet. I have added a bit more hard gamepad controls (namely L and R for cycling between patches), but also have program changes through midi already, along with pitch bend/Modwheel (for vibrato as of now, also considering having an option for it to change modulation amount of the modulating operators). Anyway, as you can imagine, a lot to decide/execute on. Haha
Re: MIDI NES
Thanks for the reply and insight. I did have a few requests re: GBMidi (and others where applicable). Unless I'm missing something, it seems that "patches" are enabled, but A) there's no way to save/load these patches independently and B) no way to un-tether from the four slots available (even fewer for noise/wav). Also, I see that certain patches use additional (8!) pulse channels, and that the wav channel is relegated to a few basic shapes.
My questions are these:
Are there plans to allow independent patch loading/storage per channel and/or global setting storage?
Are there plans for custom wav sample loading?
Are there plans for additional patch slots or custom additional pulse channel layering?
What's the discord link?
Is the ultimate goal to make a sort of virtual UltimaChip on the mister? If not, how can I build my own UltimaChip?
I hope this makes sense!
-
- Core Developer
- Posts: 5
- Joined: Sat Feb 24, 2024 7:51 pm
Re: MIDI NES
Discord: https://discord.com/invite/misterfpga
I'm open to all those considerations for GBMidi, and in fact already have custom patch loading for GenMidi (which is ready for release I just got sidetracked with trying to add visuals), so I can "port" the concepts from that over. The only reason I hadn't considered it for the pulse channels is there's no universal "patch" type for them, so I'd be more or less making my own, which also means one would have to make them in the core then save them (saving to an external file is quite limited, dealing with that with another project rn), or perhaps create them externally if I can devise a reasonable way to do so. Also, there's really not many options for the pulses; duty cycle, volume, and pitch, and since the chip only has a very basic volume envelope option (which wasn't long enough for my purposes so I also rolled my own), it's essentially just a couple parameters, which as of now are all exposed in the OSD. Now, if you wanted to say flip through patches on the fly live, that would be an issue, in which case I could expose those values to say midi ccs, or for example have patch slots that program changes can cycle between (but then we're back to how to save/load those patches in the first place). As for wav, again there's not exactly a universal wave format, but I believe there may be an easy enough way to export from say furnace tracker, in which case I can create a method for parsing that data (same as I'm doing for GenMidi with TFIs), so it's more possible. That said, that would just be the waveforms themselves and again there's layers of volume, pitch etc on top of that.
As for the UltimaChip project, I really should get around to cleaning up that code and open sourcing it. I basically immediately went to FPGA after completing the album made with it, and frankly the way to "control" it was always half baked (having to alter the firmware of the MCU bespoke for every track), but I've since thought of ways to make that process easier. One day...
Anyway, definitely feel free to jump in the discord and we can talk more synchronously, I'm happy to see people as enthusiastic about using MiSTer for music, as I am.
Re: MIDI NES
breakbeatscientist wrote: ↑Mon Apr 22, 2024 1:38 pmI 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.
You might be able to dump the nes prom portion of the midines using mapper 111
https://github.com/sanni/cartreader/blo ... .ino#L2404
as it uses 0x5000 for banking. However how well that will work is hard to say.
If the pic is only being used to receive MIDI it might be possible to implement in the core something equivalent (like the nsf midi player already does). If it is doing processing though you would have to dump its code and implement the chip
Re: MIDI NES
breakbeatscientist wrote: ↑Tue Mar 23, 2021 2:30 pmIn my quest to gather as much info on this as I can I found that the creator of the Chip Maestro cartridge Jarek Lupinski made all of his work public on Github. He has some interesting projects on there. I figured I would post them here as a reference.
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
Looking through the Chip Meastro code it appears most of the code is run on the atmega. It basically generates just enough data for a few nes instructions to set apu parameters. Nothing else runs on the nes cpu
-
- Posts: 23
- Joined: Tue Mar 16, 2021 11:29 pm
- Has thanked: 3 times
- Been thanked: 4 times
Re: MIDI NES
Memblers wrote: ↑Tue May 14, 2024 1:51 pmHi, 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.
That would be awesome! I think it needs to be preserved but I understand if he doesn't want to release it. MIDINES is definitely part of NES history I would love to see it working on the MiSTeR. Also, it's great to see you're still active in the scene.
Glad to see people are working on other promising MIDI solutions.