Banner
Views: 1,004,696,034
Time:
17 users online: 128ram, AnEvilGhost,  bebn legg, bersi, Brutapode89, DasFueller, FrozenQuills, Hitsuky, JupiHornet, kaigem, katun24, Misterfan2000, MM102, SAMYR DUTRA ARAUJO, slopcore, TheOrangeToad, VinylHeart - Guests: 96 - Bots: 96 Users: 54,888 (2,025 active)
Latest: communist mario
Tip: Proofread your message boxes for spelling and grammar mistakes.
Not logged in.
Posts by HertzDevil
HertzDevil's Profile - Posts by HertzDevil
Pages: « 1 2 »
MIDI transcription of Spring Lane ~ Colorful Path (HM) as promised on Skype.

This appears to be my first post at this forum. Hello World! I have known Vitor and Wakana (plus a few AMK users) for a while before joining this forum.
The Shining Needle Castle Sinking in the Air.

This one is never meant to be played using the "Microsoft GS Wavetable Synth"; most players will not enable the GS banks properly, and the trumpet will cut itself due to high polyphonic demand. Use something like VirtualMIDISynth (with the default GM/GS soundfont converted to a SF2 file) instead.
Each channel in AddMusicK should have its own default octave and note length. In other words, the following two pieces of MML should output the identical music data:
(this example is taken from Bach's Chorale 1)
Code
#0 @1 l2 o5			#0 @1 l2 o5
#1 @1 l4 o4                     #0 d c4 <b4 a g
#2 @1 l4 o3                     
#3 @1 l4 o2                     #1 @1 l4 o4
                                #1 d e f+ g2 f+ d2
#0 d c4 <b4 a g                 
#1 d e f+ g2 f+ d2              #2 @1 l4 o3
#2 a b >c d e d8 c8 <b2         #2 a b >c d e d8 c8 <b2
#3 f+ g a b >c d <g2            
                                #3 @1 l4 o2
                                #3 f+ g a b >c d <g2

However, in the first snippet, AddMusicK uses "l4 o2" for all channels that follow. As far as I know, none of the MML dialects allows any of these commands to have global scope across channels.

---

I should also request two purely syntactical constructs that are commonly found in other MML dialects:

1. The "#" command should allow multiple channel indices. That is to say, the following MML:
Code
#012 ; any data

should expand to:
Code
#0 ; any data
#1 ; any data
#2 ; any data

If such a command is not found, the target channel should still be set to "#0" by default rather than "#01234567".

2. Key signatures may be added anywhere with scope limited to the current channel(s), such that sharp and flat signs are automatically applied to each note that does not provide its own accidental sign. For example, the following MML:
Code
_{+fcgdae}         ; F# Major / D# Minor, melodic scale
d e f g a b+ > c++ d
_{=fcgdae} _{-bea} ; Eb Major / C Minor, melodic scale
c d e f g a= b= > c

should expand to:
Code
d+ e+ f+ g+ a+ b+ > c++ d+
c d e- f g a b > c

This syntax is taken from PMD, a dialect for the PC-98's YM2608 chip. NSD.lib, a dialect for the NES, uses "K{...}". The first character within the braces indicates the type of accidental to apply to all note names that follow it. In particular, "=" stands for the natural sign; because the equality character is never used outside replacement macros and special commands beginning with "#", no ambiguity should arise while parsing. If a note has an accidental sign, then the key signature command may be ignored for that note (as in "a= b=" above).

This also introduces double accidentals, which AddMusicK does not currently handle. They should as well be allowed since the N-SPC engine does not store the octave and pitch of each note separately.

(The compile-time transpose command "h" is not an intuitive solution; snippets like "h2 efgab" make sense only when one uses solfege names, e.g. "h2 mi fa so la ti".)
Since I no longer have to produce AddMusicK MML files to use AddMusicK, I should stay here a bit more often.

A work in progress done from memory (except not really since I did this on the Game Boy before). I am a bit surprised that I could not find it at this site's catalog. Vanilla samples only.

Super Mario Galaxy - Battlerock Galaxy
SPC - Source MML - Generated MML

Another really incomplete work in progress, not sure if I should finish this because I had lost my patience trying to reduce the vibrato lag. Open hihat is from Super Robot Wars 4, the rest are vanilla.

Touhou: Dateless Bar "Old Adam" - The Darkness Brought In by Swallowstone Naturalis Historia
SPC - Source MML - Generated MML

Also, here is the source MML of my most recent submission. The MML cross-compiler is private right now, it won't be released soon.
YouTube · Bandcamp · Twitter · Github
Constructing Chiptune; Construing 8-Bit.
Custom theme based on Zenburn; install Lato and Liberation Mono for best results
Originally posted by Theultimate12
will it be able to indeed detect loop points in the MML and loop the song without any problems?

It never "detects" loops, it only expands arbitrarily nested loops into a form AddMusicK's N-SPC driver accepts. It is your responsibility to optimize away loops.
YouTube · Bandcamp · Twitter · Github
Constructing Chiptune; Construing 8-Bit.
Custom theme based on Zenburn; install Lato and Liberation Mono for best results
Originally posted by Theultimate12
Well, I have updated to the latest Lua program (which is 5.3.3), but I`m having another error, this time a ``syntax´´ one. Here`s the errors I`m having:

https://www.dropbox.com/s/uq41c4e20axa7m6/2016-10-23.png?dl=0 (if the link doesnt work again, I`ll try and upload it again the next day)

Author of the script here.

You need none of the brackets. Whenever brackets appear in the usage texts of any command line program, you can assume that they are to be omitted.

Actually that usage text is not common practice; usually angle brackets are for parameters and square brackets for optional arguments. So it should read like:

Code
lua ftm2mid.lua <filename> [<option>] ...
YouTube · Bandcamp · Twitter · Github
Constructing Chiptune; Construing 8-Bit.
Custom theme based on Zenburn; install Lato and Liberation Mono for best results
I don't think I have ever created a thread for all of my SPC files created using AddMusicK, but it turns out there are at least a dozen that I want to include in such a post (plus I could share my own MML files), so here it is:

Work in Progress
Super Mario Galaxy - Battlerock Galaxy (source)
Touhou: Dateless Bar "Old Adam" - The Darkness Brought In by Swallowstone Naturalis Historia (source)
Zabutom - Zeta Force

Available at Music section
Castlevania: Portrait of Ruin - Gaze Up at the Darkness
Halloween (1978)
Love Live! School idol project - Love wing bell (source)
Metroid: Zero Mission - Ridley's Hideout (source)
Space Runaway Ideon - Arrow of Buff Clan (Part 1)
Touhou 15: Legacy of Lunatic Kingdom - The Sea Where One's Home Planet Reflects

Other
Bloodrayne: Betrayal - Zeta Gamma
Gensou Shoujo Taisen: You - Dream of Arcadia
Mega Man VR - Wire Man

All finished files are hosted on OneDrive. All source MML files are for my private MML cross-compiler Lua script, not AddMusicK. I might publish that if I add AMK or SMW support to my other generic MML compiler at Github.
YouTube · Bandcamp · Twitter · Github
Constructing Chiptune; Construing 8-Bit.
Custom theme based on Zenburn; install Lato and Liberation Mono for best results
SNESGSS does not use cents, it uses the SPC's pitch registers directly (the numbers you see in SPCPlay) since calculating the pitch register from an internal cent or multiplier value is expensive. Everything you do there will be twice as sensitive when you lower an octave, and half as sensitive if you raise an octave. There is a single lookup table located in any SPC file it generates, for all notes rather than only a single octave as in AMK:
Code
0042 0046 004A 004F 0054 0059 005E 0064 006A 0070 0077 007E
0085 008D 0095 009E 00A8 00B2 00BC 00C8 00D4 00E0 00EE 00FC
010B 011B 012B 013D 0150 0164 0179 0190 01A8 01C1 01DC 01F8
0216 0236 0257 027B 02A1 02C9 02F3 0320 0350 0382 03B8 03F0
042C 046C 04AF 04F6 0542 0592 05E7 0641 06A0 0705 0770 07E1
0859 08D8 095F 09ED 0A85 0B25 0BCE 0C82 0D41 0E0A 0EE0 0FC3
10B3 11B1 12BE 13DB 150A 164A 179D 1905 1A82 1C15 1DC1 1F86
2166 2362 257D 27B7 2A14 2C95 2F3B 320A 3504 382B 3B82 3F0C

For comparison this is AMK's:
Code
085F 08DE 0965 09F4 0A8C 0B2C 0BD6 0C8B 0D4A 0E14 0EEA 0FCD 10BE

The Txx command offsets the pitch register value by +xx; Uxx increases it by xx on every tick, Dxx decreases, and Pxx moves towards the target pitch at the same rate.

Tuning your samples relative to SNESGSS's pitch table is a completely different task from tuning your SPC relative to another reference pitch register table, though it is always possible to match both of them if exact accuracy is desired.
YouTube · Bandcamp · Twitter · Github
Constructing Chiptune; Construing 8-Bit.
Custom theme based on Zenburn; install Lato and Liberation Mono for best results
Two possible reasons even if the o command was never used:
  1. The default octave for an MML file is o4. Note that this applies to the MML file, not each individual channel, because:
  2. Invoking a new # command does not reset the octave to this default value.
For example, both of the following examples will emit errors:
Code
#0 c>c>c    ; o4 c o5 c o6 c
#1 c>c      ; o6 c o7 c
Code
#0 o4 c
#1 o5 c
#0 >c       ; o6 c
#1 >c       ; o7 c
It is good practice to initialize the octave at the beginning of each channel, but even then it is still impossible to interleave # commands in any AddMusicK MML file. This is in fact one of the major reasons why most users of other MML dialects never take any version of AddMusic seriously.
YouTube · Bandcamp · Twitter · Github
Constructing Chiptune; Construing 8-Bit.
Custom theme based on Zenburn; install Lato and Liberation Mono for best results
Super Mario World's N-SPC engine appears to be an earlier version distinct from other games using it. Of course it matters less now given how much the AddMusicK driver has modified against the original code.

Decompiling the music and sound effects would not take a lot of time given the right tools (i.e. what I do to hack over 15 different NES sound engines using the same MML compiler). It takes significantly more time to reorganize AddMusicK's source code into a maintainable manner.
YouTube · Bandcamp · Twitter · Github
Constructing Chiptune; Construing 8-Bit.
Custom theme based on Zenburn; install Lato and Liberation Mono for best results
Originally posted by musicalman
What other dialects of MML are you saying can be taken more seriously and why?

MCK/PMCK/PPMCK, NSD.Lib, PMD, FMP, XPMCK, HuSIC, GBMD, practically every chiptune MML compiler in existence. Even the ones not listed there will reset the octave (and default note duration) on starting a new channel.

Reusing the # command makes the MML easier to read and maintain. Songs can be grouped into phrases in the order they appear, by placing data for all channels of a part together, instead of data for all parts of a channel together. The latter creates additional work for aligning note events from multiple spatially disconnected lines of MML data. Compare this to this; which one do you think is easier to edit and diagnose for errors if the song continues to grow?

Regardless, allowing the trailing octave/note duration of one channel to spill over to the beginning of the next one violates integrity. This is a functional requirement. A new channel's initial settings should never depend on the complete definition of the previously declared one. Saying that any workaround to this qualifies as "highly advanced features or script custom behaviors, which [you] imagine some hardcore MML users might be doing" is demeaning to the increasing number of chiptune musicians who are able to use both trackers and MML compilers.

Originally posted by Brozilla
Unless there is compiler wizardry to go along with that the channels are stepped along "sequentially." That is I believe a typical music tracker is an oversimplified visual of how one might perceive it.

I don't think such a fix can be considered wizardry if all of the MML compilers listed above can do it. Switching int octave into an array like bool noMusic[8][2] or bool passedIntro[8] in src/AddmusicK/Music.cpp will do it. My own AMK cross-compiler will do it. If I start forking AddmusicK I will definitely do it too. Additionally if AMK is ever going to support N-SPC's frames/blocks, rather than just shoving the intro in the first block and the loop in another, it is going to support the interleaving of # commands anyway, because that is the natural grouping of the internal music data. There shouldn't be any reasons they are split in the manner the decompiled SMW tracks included in AddmusicK do.
YouTube · Bandcamp · Twitter · Github
Constructing Chiptune; Construing 8-Bit.
Custom theme based on Zenburn; install Lato and Liberation Mono for best results
Arpeggiation and tremolo are N-SPC features. The source code is available in the src.zip archive that comes with AddmusicK.

The SPC700 is just a sound chip. Commands are software abstractions. Manuals of varied complexity can be found online, such as this one.

It is not so much whether someone makes a tracker module to MML converter as it is whether the converter can produce useful mappings from the input format's own effect commands to a particular SPC engine's. At least two trackers have it, and they are hardly used in practice because of this.
YouTube · Bandcamp · Twitter · Github
Constructing Chiptune; Construing 8-Bit.
Custom theme based on Zenburn; install Lato and Liberation Mono for best results
Originally posted by AntiDuck
The effect used in the Ocean games have much more flexibility in use, such as going below $00 and going backwards through $FF to $80 in the reverb values and so forth, and slowing down when reaching the desired value...

I looked into the Waterworld SPC files. There is a low frequency sine oscillator built into the sound engine, that writes to the echo volume registers independently from the channel events. It appears that the LFO's frequency and phase offset are fixed, and the only controls possible are changing its amplitude. Sometimes the echo volume in Diving overflows / underflows, because the LFO operates by adding the amplified differential to a cached value, not amplifying this cached value. Regardless of the underlying implementation I do not believe that such a feature would be sufficiently useful for the general AMK user.

Originally posted by AntiDuck
...I tested out SPC2MML with one of the ports to see if it used any hex command that could be strategically using echo commands with available AMK commands, but they don't seem to, so that must mean that there is a special command that the Ocean games used.

An Ocean SPC does not use N-SPC / AMK commands and, before anyone asks, there are no such things as "SPC commands" either, not any less general than DSP writes. SPC2MML only attempts its best to collect as many DSP writes into events understood by AMK as possible, but since different sound engines have vastly different semantics (observable behaviour), detection of high-level features requiring continuous register writes is virtually impossible. In particular SPC2MML cannot detect AMK's own $F2 command. So there are only very limited conclusions you can draw from these converted MML files.
YouTube · Bandcamp · Twitter · Github
Constructing Chiptune; Construing 8-Bit.
Custom theme based on Zenburn; install Lato and Liberation Mono for best results
Yes. You cannot assume that percussion staves follow any particular scale. It is better to work with a piano roll editor; most DAWs should display GM percussion names alongside the vertical keyboard.

Most of the older video game soundtracks did not use the GM percussion series because there was no need to, although I know at least one NES game that does it.
YouTube · Bandcamp · Twitter · Github
Constructing Chiptune; Construing 8-Bit.
Custom theme based on Zenburn; install Lato and Liberation Mono for best results
Originally posted by musicalman
Not sure what was used to make the SPC either.



YouTube · Bandcamp · Twitter · Github
Constructing Chiptune; Construing 8-Bit.
Custom theme based on Zenburn; install Lato and Liberation Mono for best results
Reminder that PWM is originally employed when an arbitrary wave modulates a pulse wave at a given sample rate to approximate analog signals with a digital one (anyone with some Arduino experience knows this), but here it refers to the timbre associated with changing the pulse width of a synthesized pulse wave. In this case the modulator wave is a low-frequency triangle wave, since the pulse width changes linearly from narrow to wide and vice versa. On the other hand, you do not apply PWM on an arbitrary carrier wave; that would become some kind of FM or phase modulation.

I have been continuing to refactor the AddmusicK code on my own repository. Some of the planned changes might be present some time in this 1.1.0 release.
YouTube · Bandcamp · Twitter · Github
Constructing Chiptune; Construing 8-Bit.
Custom theme based on Zenburn; install Lato and Liberation Mono for best results
You can apply certain commands in the middle of a note by using a ^ command. The manual does not mention that this can be used without preceding it with a note. For example, this in FamiTracker
Code
     # : Triangle
ROW 00 : C-4 00 . 4XY
ROW 01 : ... .. . ...
ROW 02 : ... .. . 4XZ
ROW 03 : ... .. . ...
ROW 04 : ... .. . ...
ROW 05 : ... .. . ...

roughly becomes
Code
o4 pX,Y c8 pX,Z ^4

This is often sufficient for most purposes where this occurs. Many MML dialects and their sound engines have similar support for a tie command to various degrees. That said, vibrato has a plaintext representation, so you should always prefer them over hex commands, and if AddmusicK incorporates more plaintext commands, you should prefer those as well.

Doing this for all notes uniformly requires something like this:
Code
(!1)[pX,Y]
(!2)[pX,Z]

(!1,-1) (!2,1,8) o4 c4.

But this does not scale well if multiple changes are needed. So to solve this I managed to add a new remote code type myself, that triggers exactly once after the specified number of ticks, so that if remote code can be reconfigured inside other remote code definitions, then this will produce a crude "square" vibrato: (this requires MML compiler support, so I had to expand them into hex commands and disable validation)
Code
(!1)[$EE$00 (!2,6,=9)]		; these are equivalent to { 32 ... | 64 ... 0 ... }
(!2)[$EE$40 (!1,6,=9)]		; type 6 remote code behaves like most other types
(!3)[$EE$20 (!2,6,=24)]		; so it will overwrite existing type 0/1/2/3 codes

#0	p0,1			; required to update pitch on all ticks
	(!3,-1)			; envelope init
	c2d2e1

Where type 6 is defined as:
Code
L_10A1:

	mov	a, !remoteCodeType+x
	cmp	a, #$06					;;; ;; ; type 6 also uses the time counter
	beq	+					;;; ;; ; branch
	cmp	a, #$01
	bne	.noRemoteCode2
+	mov	a, !remoteCodeTimeLeft+x
	beq	.noRemoteCode2				;;; ;; ; prevent type 6 code from triggering more than once
	dec	a					; $FC$xx$yy$01 $00 will also not work but the impact is minimal
	mov	!remoteCodeTimeLeft+x, a
	bne	.noRemoteCode2
	call	RunRemoteCode

Code
cmdFC:
{
	; ...
	mov	!remoteCodeType+x, a			; |
	cmp	a, #$06					;;; ;; ; special handling for type 6 remote code
	beq	.callOnce				;;; ;; ; branch
	call	GetCommandDataFast			; \ Store the argument.
	mov	!remoteCodeTimeValue+x, a		; /
	ret						;
	
.callOnce						;;; ;; ;
	call	GetCommandDataFast			;;; ;; ; this does not update the timer reload value
	mov	!remoteCodeTimeLeft+x, a		;;; ;; ; instead it updates the timer current value
	ret						;;; ;; ;

This is the resulting SPC. The entire assembly code requires 17 extra bytes. The next logical step is to add a "yield" command inside remote code definitions to simplify the process of creating multi-step envelopes; in fact, such a yield command might obviate the need for another remote code type if done properly. There is always the question of whether the gained expressive power outweighs the increases code size, but if arpeggio and pulse wave pass, then so shall this.

Speaking of remote code, type 5 seems to behave exactly like type 3. It appears in the code that handles conversion from #amk=1 GAIN commands to remote code definitions. Does anyone close to AddmusicK development know why it was added in the first place?
YouTube · Bandcamp · Twitter · Github
Constructing Chiptune; Construing 8-Bit.
Custom theme based on Zenburn; install Lato and Liberation Mono for best results
There is no plaintext equivalent of the tempo fade command. The normal tempo command expands to $E2.

The P-switch speed up is controlled by another register that is not currently exposed to the AddmusicK commands.
YouTube · Bandcamp · Twitter · Github
Constructing Chiptune; Construing 8-Bit.
Custom theme based on Zenburn; install Lato and Liberation Mono for best results
I have recently got per-channel o / l states working in my own mod. Let's see if Codec will merge that, because it is one of the most requested fixes outside SMWCentral.



More about remote code commands: I discovered another trick that would work readily in the current AMK sound engine, but only if nested remote code setups are allowed:
Code
(!1)[v240 (!2,-1)]
(!2)[v240 (!3,-1)]
(!3)[v150 (!2,-1)]

#0	@9 $FA$03$FF l16
	(4)[(!1,-1)  c8 e c ge>c<g >ec<g>ec<g>ec<]2
	   [(!1,-1)  c8 d c ad>d<a >fd<a>fd<a>fd<]2
	   [(!1,-1) <b8>d<b>gd>d<g >fd<g>fd<g>fd<]2
	(4)2

This creates an envelope similar to the type 6 remote code from above, except it is only updated every time a note is triggered. It performs the following actions in sequences:
  1. (!1,-1) is issued, initializing the channel volume to 240.
  2. The next note, an 8th note, plays at the volume.
  3. The remote code calls (!2,-1) for the next note.
  4. The next note, a 16th note, also plays at the normal volume (v240).
  5. The remote code now calls (!3,-1) for the next note (the q command currently requires first setting the note length, so it cannot be used inside remote code definitions without further modification to the source).
  6. The next note is now played at a lower volume (v150).
  7. The remote code calls (!2,-1) again, going back to step 4.
This effectively produces a single-channel echo effect that is commonly used for many types of chiptune music, and if pulse wave synthesis is back, I am sure some porters will do this as well. The first (!1) is unnecessary, but saves the effort of making the first note play at full duration. Here is the resulting SPC file, compiled using AddmusicK 1.0.5. Again, the remote commands are manually adjusted to point to the correct definitions using a hex editor.

The first loop of the example is equivalent to v240c8 ev150c v240gv150e> v240c<v150g> v240ev150c< v240g>v150e v240c<v150g> v240ev150c<, but this is way more error-prone, and increases the size of the entire music data by 45 bytes even for such a small example. Some other MML dialects, e.g. PPMCK and PMD, also provide a similar macro which expands notes into individual commands during compile-time, but since AddmusicK's N-SPC engine already expresses this, I'd say that AddmusicK add support for those "nested" remote code commands (this is what I will do since it makes things more flexible), including recursive ones that refer to each other, or at least add a macro that generates such remote code sets and possibly the echoing notes.



Originally posted by AntiDuck
I thought of something, since I can understand that not many would want to use the command for their ports, how about some sort of distribution of various commands from other SNES games that aren't necessarily part of AMK, but can be inserted in the program itself like custom music or something, and perhaps they can be used in a command format like
Code
"#Custom_Command1 $XX $YY" or "#Custom_Command2 $ZZ"
or something to co-exist with other commands and not risk overwriting them or something.
Maybe this could be used for ports that require a certain command or effect to be more accurate but don't have much use for any other port or something.

I may seem to be wishing too much, but I'm just wondering if any of this could be possible, guess I'm just that interested in the LFO effect. Maybe it could be altered to also work on other values like song volume, pitch, ADSR/Gain or something to make it a little more useful?

The easiest way to do this, arguably, is to add a command line option that passes defines to ASAR (possibly creating an extra temporary file to be incsrc'd by the other sources). Whoever adds extra features in their own copy of the SPC700 source is responsible for conditionally enabling relevant code with these defines.

And no, you really cannot easily isolate any effect from another sound engine and force it into N-SPC.
YouTube · Bandcamp · Twitter · Github
Constructing Chiptune; Construing 8-Bit.
Custom theme based on Zenburn; install Lato and Liberation Mono for best results
#optimized goes into #samples, not #instruments. Near the end of the lines from channels 4 to 6 there are also some $DD commands without a corresponding note parameter; you should not assume AMK will add the notes for you because it is broken and gives a lot of unexpected results.

Yes, this is the best you could achieve with hex commands. Also F0 can be used to replace half of the $F4 $03 commands here, since it is always known which notes use echo and which do not.

And since each remote command uses 5 bytes, you do not want to use them (type -1) here.
YouTube · Bandcamp · Twitter · Github
Constructing Chiptune; Construing 8-Bit.
Custom theme based on Zenburn; install Lato and Liberation Mono for best results
Pages: « 1 2 »
HertzDevil's Profile - Posts by HertzDevil

The purpose of this site is not to distribute copyrighted material, but to honor one of our favourite games.

Copyright © 2005 - 2022 - SMW Central
Legal Information - Privacy Policy - Link To Us


Menu

Follow Us On

  • YouTube
  • Twitch
  • Twitter

Affiliates

  • Super Mario Bros. X Community
  • ROMhacking.net
  • Mario Fan Games Galaxy
  • sm64romhacks