nesdev.comhttps://forums.nesdev.com/ Can someone explain arpeggios?https://forums.nesdev.com/viewtopic.php?f=6&t=15478 Page 1 of 1

 Author: zkip [ Thu Feb 02, 2017 11:16 am ] Post subject: Can someone explain arpeggios? Now that the contest is over, I've found out that I really like coding for these old school consoles. However, a full game is a bit taxing. Long story short I'd like to get into coding demos and the likes. Some might hate them, but arpeggios play an important role in vgm history. I'm rambling on here so I'll get to the point, I'd like someone to explain from a programming stand point how to implement arpeggios into a NES music engine. I know they are usually a loop? of the base notes 3rd, and fifth. But I'm not sure how to implement that. Like do they slide or is it just three notes played at fast intervals. If so I'd also appreciate someone explaining these intervals.Thanks, zkip.

 Author: tepples [ Thu Feb 02, 2017 1:01 pm ] Post subject: Re: Can someone explain arpeggios? Assuming that by "arpeggio", you're referring to arpeggio effects in the pattern, not arpeggio-type envelopes on instruments.Let's say the pattern enables the arpeggio effect 047. This means arpeggio1 = 4 and arpeggio2 = 7. The numbers represent intervals measured in semitones: 4 is a major third above the base note, and 7 is a perfect fifth above the base note. Thus 047 represents a major chord in inversion 0.Here is pseudocode:Code:On note start:    Set arpeggio phase to 0    Remember the base pitch of the noteEach frame:    If arpeggio phase == 0:        Set pitch to base pitch    If arpeggio phase == 1:        Set pitch to base pitch + arpeggio1    If arpeggio phase == 2:        Set pitch to base pitch + arpeggio2    Add 1 to arpeggio phase    If arpeggio phase >= 3:        Set arpeggio phase to 0Let me know the first line you don't understand.This allows for no arpeggio (arpeggio1=0 and arpeggio2=0), even combinations of three notes (arpeggio1=x and arpeggio2=y), a combination of two notes with more of the base note (arpeggio1=0 and arpeggio2=x), a combination of two notes with more of the upper note (arpeggio1=x and arpeggio2=x)One enhancement is to replace the last if-then as follows:Code:    If arpeggio phase >= 3:        Set arpeggio phase to 0        If arpeggio2 == 0:            Set arpeggio phase to 1This allows an additional type of arpeggio: an even combination of two notes (arpeggio1=x and arpeggio2=0).The Pently music engine implements exactly this arpeggio algorithm. In pentlymusic.s, look around storePitchWithArpeggio.

 Author: dougeff [ Thu Feb 02, 2017 1:21 pm ] Post subject: Re: Can someone explain arpeggios? Famitracker....instrument...arpeggio...type | 0 4 7 (must have a pipe first), or | 0 4 7 4Also, other intervals are interesting...0 4 11 40 4 12 40 5 12 50 2 7 20 7 14 7etc...EDIT - 'pipe' is slang for a vertical bar.

 Author: rainwarrior [ Thu Feb 02, 2017 1:31 pm ] Post subject: Re: Can someone explain arpeggios? I'd recommend using Famitracker and trying out the arpeggio instrument envelopes.There's a lot more to it than just repeating 3 notes on successive frames. You could use 2 or 3 frames per note for a slower effect. You can use loops of other lengths, 2 notes or 7 notes or whatever sounds interesting/appropriate to you. It is often very effective combined with other types of envelopes (i.e. changes of volume or duty).Maybe also consider things besides just major or minor triads, and arpeggios wider than a single octave (12 semitones). An arpeggio might sweep up and down in order of pitch, or the the order might jump up and down erratically. They don't even have to loop! There are all sorts of interesting effects to try.There are some good examples here:https://www.youtube.com/watch?v=4HWHneafZ8wOne way to study these things is to use this NSF Importer tool to inspect NSF files in Famitracker. It breaks down everything an NSF is doing frame by frame (each frame on a single row), showing you exactly what it's made of:http://rainwarrior.ca/projects/nes/nsfimport.htmlzkip wrote:Like do they slide or is it just three notes played at fast intervals.It's not a slide effect, the pitch is changed immediately on a per-frame basis.

 Author: zkip [ Fri Feb 03, 2017 8:41 am ] Post subject: Re: Can someone explain arpeggios? Thanks guys. I understand perfectly now and it's implemented in my engine. It really is crazy all of the interesting combinations of sounds you can get with these, and I haven't even tried adding volume envelopes to them yet. My next mission is to play around with those Rob Hubbard style sawtooth DPCM tricks. Thanks again guys.

 Author: Memblers [ Sat Feb 04, 2017 12:04 am ] Post subject: Re: Can someone explain arpeggios? If you're looking for something fancy to put in a sound engine, I'd recommend taking a look at something blargg came up with:http://www.slack.net/~ant/misc/nes-saw/Such a cool trick, it's practically a crime that no one has used this in a music engine (AFAIK), other than the demos on that page. DPCM sawtooth (or other waves), with volume control..

 Page 1 of 1 All times are UTC - 7 hours Powered by phpBB® Forum Software © phpBB Grouphttp://www.phpbb.com/