Banner
The Overworld Design Contest ends in
3 DAYS, 5 HOURS, 33 MINUTES AND 59 SECONDS
Views: 906,162,943
Time:
11 users online: autisticsceptile1993, Dark Prince, Ixitxachitl,  KevinM, MassPunishment, ScatmanJones49, SimFan96, Spads, swunsh_,  Telinc1, TheGrassBlock672 - Guests: 94 - Bots: 77 Users: 50,790 (2,072 active)
Latest: Sebbaski
Tip: If you place a moon, midpoint, or dragon coin through Map16, it will always respawn whenever you reenter that sublevel. It will not respawn if you add it through the Add Objects/Extended Objects window.
Not logged in.
Struggling with octaves and loops
Forum Index - SMW Hacking - SMW Hacking Help - Custom Music - Struggling with octaves and loops
Pages: « 1 » Link
I'm working on my first AddMusick port. I choose a fairly simple song and I got the hang of the basics.

Right now i'm optimizing it by creating labeled loops, but i ran into unexpected behavior related to octaves. Look at this part of the song:

https://bin.smwcentral.net/u/49837/octaves.txt

After the repeat call (6) it should already be in octave 3, because i set o3 in the loop. But actually it plays in octave 4.

What is happening here?
Is the o command ignored in loops, or does it return the octave it was in before the loop?



Another related issue i ran into:
A part of the song i want to copy and play at a higher octave, so one channel plays the melody at o2 and the other channel at o3 at the same time.

This doesn't seem to work; both channels play at the same octave. Why?


edit: some of the code was lost in the forum post. So i replaced it with a link to a text file instead.
Loops keep the octave that they have when they're defined, while after the loop the octave depends on what's going on in the song. So, when you define the loop with o3 inside, the octave will be o3 after the loop, but when you call it later the octave won't change to o3 again, so the solution here is to redefine it after calling the loop.
About the second problem, you can't change the notes (or their octave) that play in the loop, but there's a command to transpose everything: $FA $02 $XX, where $XX is how many semitones you want to transpose notes. So in the second channel use $FA $02 $0C ($0C = 12 semitones = 1 octave up) before calling the loop, and it should work. Remember to also reset this command with $FA $02 $00 after the loop ends or the subsequent notes will be played at a higher octave too.
Thanks for clearing that up!

Is it also possible to transpose an octave down?
Yes, for $FA $02 values $80-$FF are actually negative ($FF=-1, $FE=-2, etc.) so for an octave down you can use $FA $02 $F4 ($F4=-12).
Thanks again, i read the Addmusick readme and Wakana Music Porting Tutorial, but i did not understand how to do stuff like this.

All loops are in the song now and i'm very happy with the song so far.

Right now i'm figuring out/working on:
- Vibrato (i'm using $DE $15 $80 $20 for a fairly subtle effect)
- Volume changes (Not sure about this. Some will be easy with v, but i guess i should use ASDR for mid-note volume envelopes. Are there any other commands i can use? Can i use $E8 for volume increases?)
- ASDR instruments (i figured it out how it works, but it will take for me some time to find the right setting)
- ASDR midsong
Originally posted by slogra
- Volume changes (Not sure about this. Some will be easy with v, but i guess i should use ASDR for mid-note volume envelopes. Are there any other commands i can use? Can i use $E8 for volume increases?)

If you need to fade the volume over time, then yeah either ADSR/GAIN or $E8 are best suited for that to save space and have a cleaner mml file. You can use $E8 for any kind of volume change (increase/decrease) or ADSR if you want the same fades to happen on every note (although it's more limited than $E8, since it only has a limited amount of preset settings, while with $E8 you can fine-tune the fade as much as you want, but of course it's cumbersome to use if you need it for every note).

Originally posted by slogra
- ASDR instruments (i figured it out how it works, but it will take for me some time to find the right setting)

If you want an accurate representation of what ADSR value do over time you can check this, which is an updated AMK readme with a more accurate ADSR graph. Also you can use BRR Player, with which you can set the ADSR values and hear what it sounds like on your samples.

Originally posted by slogra
- ASDR midsong

This is pretty easy to achieve, you can either define a new instrument with the different ADSR, or use the $ED command. Note though that the $ED command has a slightly different syntax than instruments (you have to subtract 8 from the first digit, so an instrument with ADSR $FF $E0 becomes $ED $7F $E0).
Here is a preview of the sampled version.

https://bin.smwcentral.net/u/49837/SuperCastlevania4-Cave-samples%2528unfinished%2529.zip

I'm using BRR Player v1.0 to tune the samples, which certainly helps. Coarse tuning is done, but i have trouble to tune them perfectly.

I tried using fade out for volume changes, but the longest settings turned out to be to fast, so i'm using ADSR for fade out instead.

The volume might change for each note. I will start working on that.
I have question about volume and echo. If i set the volume with "v" in a loop, then i cannot use the same loop for the echo because then the volume will be the same. Do you have any advice for that? Should i just not use a loop for copying the instruments echo? Or is there another way?
Originally posted by slogra
I have question about volume and echo. If i set the volume with "v" in a loop, then i cannot use the same loop for the echo because then the volume will be the same. Do you have any advice for that? Should i just not use a loop for copying the instruments echo? Or is there another way?

You can put the v command before the loop, this way you can call it other times with different v values. Just remember to set v each time you call the loop.
Pages: « 1 » Link
Forum Index - SMW Hacking - SMW Hacking Help - Custom Music - Struggling with octaves and loops

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

Copyright © 2005 - 2021 - 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