

- #Project triangle strategy demo length how to#
- #Project triangle strategy demo length driver#
- #Project triangle strategy demo length code#
Turns out the runtime library for cc65 was doing some self-modification of the code (for some tables or something) and my memory mappers weren’t handling that correctly (and ended up segfaulting). It was fun debugging some issues in my emulator to get it to work with the ROM.

#Project triangle strategy demo length driver#
So the octave code, spits out a super inefficient c-code representation of the commands to drive the audio on the NES, and there is a small driver program to visualize some of the parameters of the audio channels. I noticed that there was a c-compiler (cc65) that already had support for NES, and that there was a runtime library with some crude drawing abilities. Anway, it was fun to play around with this, and for the most part if you know how the audio is parameterized, you can easily simulate how things would sound.īut it is much more fulfilling to actually build a ROM. I guess harmonics should probably be handled better–and transients (like percussion) should likely be handled more effectively. Basically, I did this greedily, finding the best matching parameters (which are frequency, duty-cycle type, and volume) for each of the 4 waveforms. So, given an input, we can do some Fourier analysis on the input (in block sizes of 1024, 2048, 4096 samples), and try to decompose the input audio signal into the best parameters from the NES signal components. I remember when writing a NES emulator (back in University) that I was surprised at how the Super Mario Brothers song had used the noise channel as percussion. NES audio is composed of 4 signal components: 2 square waves, 1 triangle wave, and a noise channel. Again, I’m sure there are tools to do this, but I was just interested in seeing what I could build on a one or two day deadline. Also didn’t have any cool ideas of what to build.Īnother project that I’ve thought about in the past, was whether I could get the NES to synthesize some audio from an actual song.

I know that there are good tools (like NESMaker) for building up a game, but I mostly tinker around with NES because I like the low-level stuff - so using an engine-like tool didn’t seem like something I wanted to take up right now. I was looking into hobby things to do over this last Christmas break, and thought about building up a game. I’d somehow built a mostly functional emulator (which is somewhat surprising in hindsight), and have had some toy projects around this in the past (like trying to automatically turn the renderings into 3D, )īut, I’d never actually built a ROM or built anything that used the platform. More details, along with the source code here: Įver since undergraduate days, I’ve always been interested in the NES platform. It kind of worked, and the agent was able to learn to pump at the correct times. I ended up with hacking a simple mass / spring which has no connection to a physical model. I’m bad at physics, so one of the most challenging parts was to work some model of the “pump” into the physics model that was controllable by the agent…kind of like how we use our arms and legs to pump. I setup a small simulation to see if this was possible. I ended up not focusing on height, but rather pump-ability.
#Project triangle strategy demo length how to#
Given that I’ve been playing around with reinforcement learning lately, I was curious if I could setup a simple environment and get an RL agent to learn how to pump in order to get maximum efficiency. I’ve been trying to see what gets you to go higher (e.g., ), but haven’t fully unlocked it yet. I suspect that the details around this are not something that are easily communicated, and lots of it is becomes second nature (and is likely done by muscle-memory / feel). Like doing an ollie on a skateboard, there is lots of technique that experienced people have that makes them effective, confident, and able to jump high. You don’t know me, but lately I’ve been getting super interested in learning to jump on a dirt jump bike.
