SNES music program

Discussion of hardware and software development for Super NES and Super Famicom. See the SNESdev wiki for more information.

Moderator: Moderators

Forum rules
  • For making cartridges of your Super NES games, see Reproduction.
calima
Posts: 1745
Joined: Tue Oct 06, 2015 10:16 am

Re: SNES music program

Post by calima »

Well, he could develop a mic that passes data via the controller or expansion ports :P
psycopathicteen
Posts: 3140
Joined: Wed May 19, 2010 6:12 pm

Re: SNES music program

Post by psycopathicteen »

I've updated it quite a bit.

To make a user defined instrument, set the instrument parameter to 3, and press left or right to go to the user defined instrument screen. Sample size is (N+1)16 where $0000 is 16 samples, and $03FF is 16384 samples. You can mix up to 4 oscillators. The "wave" parameter doesn't do anything yet so just ignore it. A frequency of $0400 is "normal". In order to hear it, you must press render to update the BRR sample to the SPC700 chip.
Attachments
music program.zip
(21.68 KiB) Downloaded 487 times
User avatar
Drew Sebastino
Formerly Espozo
Posts: 3496
Joined: Mon Sep 15, 2014 4:35 pm
Location: Richmond, Virginia

Re: SNES music program

Post by Drew Sebastino »

What are the controls? I can move the cursor around, but I haven't been able to make anything happen beyond that, unfortunately. It might be a good idea to include a readme file at some point for if you plan on distributing it outside of NESDev. Fantastic work, by the way.
psycopathicteen
Posts: 3140
Joined: Wed May 19, 2010 6:12 pm

Re: SNES music program

Post by psycopathicteen »

It uses the keyboard and the mouse.
User avatar
Drew Sebastino
Formerly Espozo
Posts: 3496
Joined: Mon Sep 15, 2014 4:35 pm
Location: Richmond, Virginia

Re: SNES music program

Post by Drew Sebastino »

Okay, I see now. I wasn't expecting whatever is mapped to the start button to enable you to modify the values.
psycopathicteen
Posts: 3140
Joined: Wed May 19, 2010 6:12 pm

Re: SNES music program

Post by psycopathicteen »

I've been starting to work on this thing again, and I'm wondering how much of a difference there will be between a BRR sample using only filter 0 (raw 16-bit PCM) blocks and a BRR using all 4 filters. I got the range bits working, but not the filter bits.
lidnariq
Posts: 11432
Joined: Sun Apr 13, 2008 11:12 am

Re: SNES music program

Post by lidnariq »

The filter bits "just" let you trade off some amount of sharpness for some amount of reduction of quantization noise. As to how to decide when is appropriate? Last time I said to pick it as a function of what desired frequencies exist in your output, and use the filters to remove higher harmonic content.
psycopathicteen
Posts: 3140
Joined: Wed May 19, 2010 6:12 pm

Re: SNES music program

Post by psycopathicteen »

music engine.zip
(22.27 KiB) Downloaded 418 times
Now you can use 4 waveforms for the additive synth section:
1: square
2: 25% pulse
3: 12.5% pulse
4: sawtooth

The part that does BRR sample conversion automatically decides if sample blocks use filter 0 or filter 1. I didn't implement anything with filter 2 or filter 3 yet.
psycopathicteen
Posts: 3140
Joined: Wed May 19, 2010 6:12 pm

Re: SNES music program

Post by psycopathicteen »

I just got the system to do a complete conversion from PCM to BRR. I think I'll hold off posting an update until I have some more features. I think I'll do add FM synth next.
psycopathicteen
Posts: 3140
Joined: Wed May 19, 2010 6:12 pm

Re: SNES music program

Post by psycopathicteen »

I'm still working on this occasionally, I was just busy with my homebrew game and the Gradius III optimization patch.

I just had an idea to simplify how sample loop points will work. Instead of defining the sample length and oscillator frequencies independently, they can be defined by parameters in a math equation.

loop length = (fundamental wavelength)*(waves per loop)
oscillator frequency = (harmonic frequency)/(fundamental wavelength) + (detune amount)/(loop length)

The higher the waves per loop, the smaller the detune amount steps are from each other. The attack portion of the sample, can be any length in blocks, and the software ADSR parameters on the oscillators will freeze during the looped section.
turboxray
Posts: 348
Joined: Thu Oct 31, 2019 12:56 am

Re: SNES music program

Post by turboxray »

psycopathicteen wrote: Sat Mar 14, 2020 10:54 am I'm still working on this occasionally, I was just busy with my homebrew game and the Gradius III optimization patch.

I just had an idea to simplify how sample loop points will work. Instead of defining the sample length and oscillator frequencies independently, they can be defined by parameters in a math equation.

loop length = (fundamental wavelength)*(waves per loop)
oscillator frequency = (harmonic frequency)/(fundamental wavelength) + (detune amount)/(loop length)

The higher the waves per loop, the smaller the detune amount steps are from each other. The attack portion of the sample, can be any length in blocks, and the software ADSR parameters on the oscillators will freeze during the looped section.
What's your Gradius optimization patch about? Does it use the original processor???
psycopathicteen
Posts: 3140
Joined: Wed May 19, 2010 6:12 pm

Re: SNES music program

Post by psycopathicteen »

Post Reply