Update: Solution found, please ignore.
2 Dec 3, 2018 8:53 am
Topic: Sequencing Music (NES ASM) (1 replies, posted in Nintendo Consoles)
Hey All, me again!
So, in my last post I was trying to achieve a fade effect manually, but i found that simply changing bits 5 and 6 on the value written to $4000 would do that just fine for my needs AND I can modify the length using the highest 5 bits written to register $4003. Awesome.
Now my issue seems to be an inability to trigger a sequence of more than one note.
I know that once the counter reaches 0 on the note length, the flag for the note length at register $4015 will set to 0.
My code looks like this:
.inesprg 1
.ineschr 0
.inesmap 1
.inesmir 0
.bank 1
.org $FFFA
.dw 0 ;vbank
.dw Main
.dw 0
.bank 0
.org $C000
Main:
;period/frequ and also set length
One:
JSR D3
ldx $4015
cpx #%00000000
beq Two
Infiniteloop
jmp Infiniteloop
Two:
JSR D4
jmp Infiniteloop
D3:
;D3, eighth note
lda #%00000001
sta $4015
lda #%10011111
sta $4000
lda #%11111001
sta $4002
lda #%01001010
sta $4003
RTS
D4:
lda #%00000001
sta $4015
lda #%10011111
sta $4000
lda #%01111100
sta $4002
lda #%01001001
sta $4003
RTS
In my head, the code should.
1. From main, jump to my subroutine D3, where I
a. enable PU1 by writing 1 to the first bit of register $4015
b. write the duty cycle/volume/period/length data to registers $4000, $4002, and $4003
c. return to main
2. Load the value stored at $4015 to the x register
3. test the value against a correct zero-d out $4015, meaning that the timer on PU1 had counted to zero
4. Jump to D4, where i would do the same process as in step one.
On paper, i feel like my code checks out, but clearly i am missing something here, so if anyone could help me (again) that would be extremely cool.
Thanks!
3 Dec 3, 2018 3:23 am
Topic: NES APU Fades (4 replies, posted in Nintendo Consoles)
Hello Everyone! I'm back with another NES sound related question.
Having scrapped getting sound from the NES via a .nsf file, I have been trying to hard-code some little ditties into the chip in assembly.
My current process is this: I am making separate sub-routines for each note/note length and then calling them in an order, to form a sort of song.
Right now, my code for the note D, with a fade out looks like this:
D3:
;pitch D3
lda #%11111001
sta $4002
lda #%10000010
sta $4003
;volume & pulse width
;fade out
;F-D-B-9-7-5-3-2-1-0
lda #%00111111
sta $4000
sta $4000
sta $4000
sta $4000
sta $4000
sta $4000
lda #%00111101
sta $4000
lda #%00111011
sta $4000
lda #%00111001
sta $4000
lda #%00110111
sta $4000
lda #%00110101
sta $4000
lda #%00110011
sta $4000
lda #%00110010
sta $4000
lda #%00110001
sta $4000
RTS
and to an extent, this works! the NES generating a D3 pitch. HOWEVER: the fade is not working as expected. What I expect to happen is for the note to hold at maximum volume for a moment, before going down in volume. what happens in actuality, is that the APU only seems to be reading (from what i can hear) the last write to $4000, meaning that i have a steady tone at volume 1, rather than a tone that decreases in volume. If anyone can help me troubleshoot this, that would be very helpful.
Note: I understand that the length can be changed via the highest 5 bits written to $4003, but I still would like to experiment with this method and get it to work.
4 Nov 8, 2018 2:01 am
Re: Assembly/Differences in .NSF Files (7 replies, posted in Nintendo Consoles)
Don't worry about $70-$77, just check it's all zeroes (that means no bankswitching). If it's not all zeroes however, you're not gonna be able to use the simple playback method from the nerdtracker example.
Thank you for all the info! It looks like i will need to do some bank switching since bytes $75-$77 are non-zero values (thanks deflemask). I appreciate all the help, and I will use this information in order to (hopefully) get something working in the near future.
Thanks!
5 Nov 7, 2018 11:30 pm
Re: Assembly/Differences in .NSF Files (7 replies, posted in Nintendo Consoles)
NSF files can (and do!) have different load/init/play addresses. Take a look here: https://wiki.nesdev.com/w/index.php/NSF.
Download a hex editor if you don't have one, it's invaluable for quickly looking inside .NSFs (I use XVI32 personally). Definitely check you're not playing a bankswitched NSF, that's way more complicated that this example you've posted can handle (to the point of requiring custom hardware).For non-bankswitched NSFs, this should work. If the load address is not $8000, change the
.org $8000
before
.incbin
Also modify the init and play constants and you should be set!
(I dunno why the code defines the load address and then just hardcodes it, oh well)Good luck! :]
EDIT: Don't forget to strip the header from the .NSF before including it!
Hey, thank you for the information, but i still have a few questions (I am very new to this). First, how do I determine that the load address is not $8000? Do I simply look for where the bulk of the hex data (song data) is? In my case, the largest chunk of the data IS located at address $8080 (with $8000 being the beginning of the file). In a similar fashion, i am unsure how to modify the init and play registers accordingly.
I tried to manually copy the data stored at $070-$077 into the registers denoted by the table on the NESDEV wiki but other than turning my emulator screen white (?), there was no change in audio playback.
Any more pointers would be very helpful, thank you.
6 Nov 7, 2018 1:37 am
Topic: Assembly/Differences in .NSF Files (7 replies, posted in Nintendo Consoles)
Hey Everyone!
For my Senior Independent Project in college, I have decided to try my hand at writing code for the NES in 6502 Assembly. Having graphic rendering more or less handled, i am now moving on to audio playback. I found some code for nerdtracker .nsf playback here:
https://wiki.nesdev.com/w/index.php/Ner _in_NESASM
I assumed it would work with all .nsf files. However, after exporting my .nsf from deflemask and running the code, I was able to create a NES rom but without any audio playback. Is there a difference in .nsf files generated by different pieces of software? Am I missing something? Any help on this issue would be very helpful.
Thanks!
7 Mar 6, 2017 7:17 pm
Re: How does one play live chip music... (184 replies, posted in General Discussion)
Crooked Sidewalks wrote:I still feel like pressing play on the trackers isn't right... What options do I have?
Well, if you are in a situation where you are just going to "press play" on a PC tracker, then why not break it into parts and drop it into something like Ableton Live or (better still) Maschine and use a cool surface to control your sequencing with the laptop shut? It seems a bit silly when you have all that computing power to just hit play in a tracker and jump around. Especially if you've already rendered the Famitracker waveforms.
If you do keep it running in the tracker, you could potentially add "loop" points and choose when to break the loops or switch channels / parts on and off on the fly (which is what I do on the Amiga). I also channel split and put (in my case) CH 1&4 and 2&3 on separate channels of a Pioneer DJM800 which has mappible effects processor and dedicated pass filters. Or I use a couple of Kaos pads if I can't take the 800. Sometimes, due to the sound system, instruments need turning up and down to sit better in the mix on the fly too so it's worth keeping a listen to the track. :-)
This is a great idea! You could also use a device like an SP404 or other performance oriented sampler so that you have access to effect and whatever other sounds you want. combining the two would be something like splitting the lead from the rest of the track and putting them on separate pads. you could also midi sync to a device like this, if you so desire.
8 Dec 9, 2016 6:34 pm
Re: Complete Gameboy Trackers, Sequencers, Synths list . . . (94 replies, posted in Nintendo Handhelds)
The MOUKI link sends me to an adult dating site? Anyone else coming across this?
9 Feb 15, 2016 10:11 am
Re: [SOLD] FS: (Ongaku Tsukuru - Super Famicom) (Currah Speech 64) (4 replies, posted in Trading Post)
What is the slot in the top of the ongaku cart for?
10 Sep 7, 2015 8:48 pm
Topic: WTB: Tenori On for Wonderswan (1 replies, posted in Trading Post)
I saw this video of Tanikugu performing with a wonderswan and tenori-on and came to discover that there was a version of the classic sequencer for the handheld, and thus the hunt has begun. If you have a copy, or find links to some for sale please post below!
video in question: https://www.youtube.com/watch?v=C6mCPqJgfAo
Thanks!
11 Mar 17, 2015 8:48 am
Re: [US,IL] Chicago Chiptune Festival 4/17-4/18 (2 replies, posted in Past Events)
Diode told me to make a post.
If a mod wants to kill this thread go for it.
12 Mar 17, 2015 6:04 am
Topic: [US,IL] Chicago Chiptune Festival 4/17-4/18 (2 replies, posted in Past Events)
Chicago Chiptune Festival
~SECRET LOCATION~
April 17th-18th
Featuring:
NO EYES
Auxcide
Solarbear
Saskrotch
CCDM
PANDAstar
Tri Angles
8 Bit Jin
Kkrusty
Diode Milliampere
Nonfinite
Storm Blooper
Snesei
Shoujo Kiss
venoSci
Sinthoid
+OPEN MIC+
Visuals By:
Sam Rolfes
Ohhinaifu
the_machinist
befunderbunk
venoSci
+vending by Toasty Co+
For more info and tickets:
CCF2015.tumblr.com
13 Dec 9, 2014 7:45 am
Re: WTB:GP2X or Caanoo (14 replies, posted in Trading Post)
Raspberry PI can also run all the required software you are looking for.
If I wanted to use a computer, I would just run resolume on my mac (which I already do)
A lot of the appeal of it to me is the fact that it's a handheld games console.
14 Dec 9, 2014 12:24 am
Re: WTB:GP2X or Caanoo (14 replies, posted in Trading Post)
arfink wrote:They are pretty darn rare, and people who own them usually don't sell them used unless something on them breaks.
yeah, im about to sell a gp2x f200 for parts since the sd card slot died on it
selling my a/v cable and piggy->midi too
Is there another way to load games onto it? and how much would you be willing to sell it for as is?
15 Dec 7, 2014 9:50 pm
Re: WTB:GP2X or Caanoo (14 replies, posted in Trading Post)
If anyone has one that they feel is reasonably priced, they should let me know.
16 Dec 7, 2014 8:53 pm
Topic: WTB:GP2X or Caanoo (14 replies, posted in Trading Post)
Looking for something to run LSDJ, Piggy, and the Pikilipita VJ software. Needs to have the A/V cables. would like to keep the price <100 usd.