Language…
18 users online:  AmperSam,  Anorakun, Beed28, DanMario24YT, gizmo_321, Golden Yoshi, Green, h.carrell, Hammerer, JezJitzu, Mohamad20ZX, OrangeBronzeDaisy, Papangu, recam, Serge, signature_steve, SMW Magic, Spedinja - Guests: 280 - Bots: 402
Users: 64,795 (2,370 active)
Latest user: mathew

Label Octave

Having a little trouble understanding what's going on here so maybe someone could help me out.

Imagine I have a line like this:

Code
o3
(1)[g+ r g+ r g+ r]

Now i'd like to play this back except one octave higher. So if I do this:

Code
> (1)

or

Code
o4 (1)

(1) still plays back at o3. So do labels like (1) retain which octave they were played at when they were defined even if the 'o3' isn't included in the label's definition? If so, is it possible to play back (1) starting at o4 without defining a new label?

Also something kind of unrelated, but does white space between notes in a text file take any extra time/resource to insert and play within a rom?

Thanks
Labels always retain their octave. So you'd need to make a new label or you can use $FA $02 which raises pitch by semitones.

Something like:

Code
$FA $02 $0C
(1)
$FA $02 $00


Which raises the pitch by 12 (0C) semitones, an octave.
Make sure you reset it with $FA $02 $00.


And no having spaces between your notes makes no difference to AMK when inserting to your rom.
________________________________________________________
Mario the Gaul
Thanks for the response. Might as well ask a few more questions here instead of continuously making threads.

First thing should be easy enough: what's the most efficient way of sustaining a note for a long time (like an entire song)? Surely it wouldn't be something like c1^1^1^1^...

Second is a little more in depth. I'm having trouble grasping how ADSR works within the context of addmusic as it seems to contradict how I've perceived it's usage outside of smw. Please correct me if I'm wrong. Attack is the time it takes for a note to reach its peak volume. Delay is the time it takes for a note to go from its peak to its sustain volume. Sustain is a ratio indicating what fraction of the note's max volume to play and will continue at this volume as long as the note is held. Release is the time it takes for a note to fade out after the key has been released. This is my understanding. However, if I have a note like c1^1^1^1 that uses ADSR, it begins to fade out long before the key is released, which would imply sustain actually having a set time rather than playing the note infinitely while the key is sustained.

Again, clarification is appreciated.

Thanks
Originally posted by ggamer77
Labels always retain their octave. So you'd need to make a new label...


This is correct. But for the sake of clarification: o, < and >, and also h (discussed below) are actually not NSPC commands at all; they simply tell AddmusicK to play different notes. So whether you write o4c, o2>>c, o1>>b+, or o6<<<<><<>>>><<h9d+, they will all play the same note and be exactly the same insert size. If we extend this to loops, all of that is handled by NSPC. Since octave commands are an AMK thing, they are not actually stored in a loop, only the resultant notes are in the NSPC sequence data, and this is why you cannot change octaves in recalled loops in a conventional way. Furthermore, if you make a loop, switch octaves and recall that loop, then the octave you will be in afterwards will not be the octave of the loop. The octave will instead be the one you were in before you recalled the loop. So in this example:
Code
[o3 c e g]2
< c d e f g *

You will be in o2 after the *, not o3.

Quote
You can use $FA $02 which raises pitch by semitones.

This is actually something I didn't know, I thought $fa $02 was an alias for h. As it turns out, this isn't the case. h just transposes the notes on AMK's side, $fa $02 seems to let you transpose within nspc. Just tested it, and it is indeed possible to transpose loops in this way. Thank you so much for figuring this out, as there's a port I'm working on which will really benefit from this knowledge!

As an aside, you can use $fa $02 to go above o6 if you have a sample that'll go up into that range without hitting the upper rate limit. Doesn't work the other way around, you can't get below o1 unless you lower the instrument's tuning to give yourself extra lower octaves. Haven't tested this but that command might? also be useful with pitch bend and legato commands if you need to make really really wide slides for some reason that go beyond 6 octaves, of course with some added expense to insert size if used often.

Originally posted by MiracleWater
What's the most efficient way of sustaining a note for a long time (like an entire song)? Surely it wouldn't be something like c1^1^1^1^...

There are two ways you can try to reduce that, you can try to put the ^1 in a loop but I've just tested that and it doesn't work for extending notes. So the only other way I can think of is to use the = command, which isn't documented. Found it in a port that I liked and figured it out. It basically is another way of specifying note duration. Here's how it works: each note is split up into 48 ticks per beat internally, and = lets you manually specify the number of ticks something gets. So c=48 would be equivalent to c4. c=12 would be c16, c=1 would be c192, which is the smallest note length you can use. Normally = doesn't really need to be used, it's only in special cases like this one that I can see a use for it. You can use = to extend a note as much as you like; the longest I ever did was =1488 which is 31 beats, and it sounded fine so you could do longer, and probably combine with ^=. Again, not sure if it's the most efficient in terms of insert size, but it certainly looks a little nicer if you are good at multiplication and don't like seeing ^1^1^1^1... Just have a calculator on hand! :)

Quote
I'm having trouble grasping how ADSR works within the context of addmusic as it seems to contradict how I've perceived it's usage outside of smw.

You would be correct, The SPC700 has an ADSR which is a little different than general usage in synthesizers for example. For now I'll leave the hex notation for ADSR for another time, but I or someone else can try to explain further if you like. There are several explanations of it on the forums that helped me out, in addition to experimenting a lot. For now I'll simply describe what the SpC's ADSR does.
A (attack) is what you'd expect, the amount of time a note fades from silence to full volume when it is keyed.
D (decay, not delay), is similar to the decay control in most ADSR implementations. Once the attack is over, the decay determines how quickly the note goes from full volume to sustain level.
S (sustain) indicates at what level to sustain at once the decay is over.
R (release) isn't release in the typical sense you'd expect, where the release would only start when you release a note. In this case, the release starts as soon as decay ends. In other words, the sound will attack, decay, then reach the sustain level and then immediately fade to silence from there. The speed of this fade to silence is controlled by the release value, which if set at 0, will leave the sound to sustain infinitely. If you want to have a sound release in the traditional sense where it sustains infinitely until told to release, you will have to use remote codes. But again I won't go too advanced right now, just wanted to directly answer your question and allow you to pose further questions as needed.

Sorry for the long post, but I hope it has helped you out!
Make more of less, that way you won't make less of more!
Ah awesome musicalman, that clears things up. Thanks for the response.
I'll have to look into remote codes, im sure there is documentation somewhere on them.
I believe it's better to unroll the loop alltogether. I mean, the note sequence you want to loop is so small, you'll end up wasting bytes instead.
Originally posted by MiracleWater
Ah awesome musicalman, that clears things up. I'll have to look into remote codes, im sure there is documentation somewhere on them.

Yep, in the readme for AddmusicK, there's a bit on remote codes in the "for porters" section, general commands I think is what the page is called. They're a bit of a pain sometimes but they work.

Originally posted by MarioFanGamer
I believe it's better to unroll the loop altogether. I mean, the note sequence you want to loop is so small, you'll end up wasting bytes instead.

Not sure which code that was directed at, but in the case of mine, that would certainly be true. I was just pointing out concepts. If you use larger loops where looping is actually useful, it's important to keep in mind how the octaves will work.
Make more of less, that way you won't make less of more!