Skeetendo

’Cause all games were better on the GBC

You are not logged in.

#1 2016-05-31 21:30:57

YORAMRW
Member
From: The Netherlands
Registered: 2013-03-29
Post 1,154/1,194
Website

Making a proper GSC PokeAsm song

I need help with making a PokeAsm. I basically want the PokeAsm to start with a pattern, then playing a 2nd pattern, then playing the 1st pattern again, then playing a 3rd pattern, then again playing the 1st pattern, then playing a 4th pattern, then playing the 1st pattern once again, and then playing a 5th pattern.

Like this:

Pattern1
[NOTES/CMDs]
Pattern2
[NOTES/CMDs]
Pattern1
[NOTES/CMDs]
Pattern3
[NOTES/CMDs]
Pattern1
[NOTES/CMDs]
Pattern4
[NOTES/CMDs]
Pattern1
[NOTES/CMDs]
Pattern5
[NOTES/CMDs]
loopchannel 0, Pattern1

Making the PokeAsm in general goes very well, but whenever I try to make the PokeAsm reuse the 1st pattern further in the song, the PokeAsmPlayer.exe freezes when I drag the ASM into it.
I hope someone can help me out with this.


Hacks Gameboy 8-bit music in Pokémon Gen I & II, composes 8-bit music in FamiTracker

Offline

#2 2016-05-31 23:45:04

comet
Member
Registered: 2012-04-09
Post 641/679

Re: Making a proper GSC PokeAsm song

.loop
    callchannel .pattern1
    callchannel .pattern2
    callchannel .pattern1
    callchannel .pattern3
    callchannel .pattern1
    callchannel .pattern4
    callchannel .pattern1
    callchannel .pattern5
    loopchannel 0, .loop

.pattern1:
    ...
    endchannel

.pattern2:
    ...
    endchannel

; etc

As for the freeze, you can't define a label twice. If you take out the repeat labels it will work.

Last edited by comet (2016-06-01 16:49:31)

Offline

#3 2016-06-01 00:30:16

YORAMRW
Member
From: The Netherlands
Registered: 2013-03-29
Post 1,155/1,194
Website

Re: Making a proper GSC PokeAsm song

comet wrote:

As for the freeze, you can't define a label twice. If you take out the repeat labels it will work.

So that means there is no way to re-use a pattern throughout the song? There should be.. The Game Corner music for instance did something exactly the same like you did in the example code, and it works just fine. But when I try the method of the Game Corner music/what you did in that code, it just only plays the first pattern and then stops playing that channel.


Hacks Gameboy 8-bit music in Pokémon Gen I & II, composes 8-bit music in FamiTracker

Offline

#4 2016-06-01 13:50:23

YORAMRW
Member
From: The Netherlands
Registered: 2013-03-29
Post 1,156/1,194
Website

Re: Making a proper GSC PokeAsm song

So how can I make the song fully work while re-using pattern 1? I did the code for my song exactly like Comet did in the example, but the PokeAsm player only plays pattern 1 once and stops playing. :/


Hacks Gameboy 8-bit music in Pokémon Gen I & II, composes 8-bit music in FamiTracker

Offline

#5 2016-06-01 16:50:13

comet
Member
Registered: 2012-04-09
Post 642/679

Re: Making a proper GSC PokeAsm song

sorry, typo in previous post

"loopchannel .loop" -> "loopchannel 0, .loop"

post exact code if you need debugging help

Offline

#6 2016-06-01 17:02:55

YORAMRW
Member
From: The Netherlands
Registered: 2013-03-29
Post 1,157/1,194
Website

Re: Making a proper GSC PokeAsm song

Well, here it is:

Music_SongExample:
    dbw $80, Music_SongExample_Ch1
    dbw $01, Music_SongExample_Ch2
    dbw $02, Music_SongExample_Ch3

Music_SongExample_Ch1:
    ftempo $50
    volume $77
    notetype $3, $A2
    dutycycle 2
Music_SongExample_Ch1_loop:
    loopchannel 0, Music_SongExample_Ch1_loop

Music_SongExample_Ch2:
    ftempo $50
    volume $77
Music_SongExample_Ch2_loop:
    callchannel Music_SongExample_Ch2_Ptn1
    callchannel Music_SongExample_Ch2_Ptn2
    callchannel Music_SongExample_Ch2_Ptn1
    callchannel Music_SongExample_Ch2_Ptn3
    callchannel Music_SongExample_Ch2_Ptn1
    callchannel Music_SongExample_Ch2_Ptn4
    callchannel Music_SongExample_Ch2_Ptn1
    callchannel Music_SongExample_Ch2_Ptn5
    loopchannel 0, Music_SongExample_Ch2_loop

Music_SongExample_Ch2_Ptn1:
    ...
    endchannel

Music_SongExample_Ch2_Ptn2:
    ...
    endchannel

Music_SongExample_Ch2_Ptn3:
    ...
    endchannel

Music_SongExample_Ch2_Ptn4:
    ...
    endchannel

Music_SongExample_Ch2_Ptn5:
    ...
    endchannel

Music_SongExample_Ch3:
    notetype $3, $22
    ftempo $50
Music_SongExample_Ch3_loop:
    ...
    loopchannel 3, Music_SongExample_Ch3_loop
Music_SongExample_Ch3_variation:
    ...
    ...
    ...
    ...
    ...
    loopchannel 0, Music_SongExample_Ch3_loop

Channel 1 is not (yet) in use, as you can see. Channel 3 works completely fine and just goes on after channel 2 stops playing, for your information.
(. . . equals one bar/measure)

Last edited by YORAMRW (2016-06-01 17:13:51)


Hacks Gameboy 8-bit music in Pokémon Gen I & II, composes 8-bit music in FamiTracker

Offline

#7 2016-06-02 16:33:06

YORAMRW
Member
From: The Netherlands
Registered: 2013-03-29
Post 1,158/1,194
Website

Re: Making a proper GSC PokeAsm song

Anyone still gonna help me?


Hacks Gameboy 8-bit music in Pokémon Gen I & II, composes 8-bit music in FamiTracker

Offline

#8 2016-06-02 16:59:31

ShantyTown
Member
Registered: 2013-12-04
Post 297/344

Re: Making a proper GSC PokeAsm song

What does pattern 1 actually contain?  The code you posted looks correct.  However, something in pattern 1 might be causing the problem.

Offline

#9 2016-06-02 17:16:43

YORAMRW
Member
From: The Netherlands
Registered: 2013-03-29
Post 1,159/1,194
Website

Re: Making a proper GSC PokeAsm song

ShantyTown wrote:

What does pattern 1 actually contain?  The code you posted looks correct.  However, something in pattern 1 might be causing the problem.

As far as I know there is nothing in pattern 1 or even in any other pattern causing the problem. Only notes and commands like vibrato and notetype are in them.

PS: As you might have noticed, I'm very hard with leaking out actual musical content of the song. That's because I don't want my work getting stolen. (By a certain person, whom we probably all know who I'm talking about) ;)

But believe me, it really doesn't matter for the debugging if I include the actual musical content or not.


Hacks Gameboy 8-bit music in Pokémon Gen I & II, composes 8-bit music in FamiTracker

Offline

#10 2016-06-02 18:38:55

ShantyTown
Member
Registered: 2013-12-04
Post 298/344

Re: Making a proper GSC PokeAsm song

YORAMRW wrote:

As far as I know there is nothing in pattern 1 or even in any other pattern causing the problem. Only notes and commands like vibrato and notetype are in them.

PS: As you might have noticed, I'm very hard with leaking out actual musical content of the song. That's because I don't want my work getting stolen. (By a certain person, whom we probably all know who I'm talking about) ;)

But believe me, it really doesn't matter for the debugging if I include the actual musical content or not.

Not sure I can help much more without seeing the rest of the code. The stuff you have above looks correct and is essentially the same organization as existing songs that work properly.  Here's an example of me doing pretty much the exact same thing (except with channel 4): https://github.com/huderlem/pokestyle-m … e.asm#L507

Offline

#11 2016-06-08 17:39:24

YORAMRW
Member
From: The Netherlands
Registered: 2013-03-29
Post 1,162/1,194
Website

Re: Making a proper GSC PokeAsm song

I've resolved the looping issue by myself. Sorry for ignoring your posts, it was already on Saturday when I resolved the issue, but I was very busy all the time and I wanted to playback the song in the real Pokémon Crystal ROM on an emulator instead of in the PokeAsm player, so I waited with revealing anything until I managed to compile the pokecrystal disassembly with my custom song.

Here is the actual result ;)
It's the drop of Dropgun's electro/bigroom track "Amsterdam", as based on my FamiTracker devamp of the entire song

The way to resolve the looping issue was basically to put the loopchannel command below the pattern last played by a channel instead of below the callchannel commands in the .loop pattern
So basically this:

.loop
    callchannel .pattern1
    callchannel .pattern2
    callchannel .pattern1
    callchannel .pattern3
    callchannel .pattern1
    callchannel .pattern4
    callchannel .pattern1
    callchannel .pattern5

.pattern1:
    ...
    endchannel

.pattern2:
    ...
    endchannel

.pattern3:
    ...
    endchannel

.pattern4:
    ...
    endchannel

.pattern5:
    ...
    loopchannel 0, .loop

Instead of this:

.loop
    callchannel .pattern1
    callchannel .pattern2
    callchannel .pattern1
    callchannel .pattern3
    callchannel .pattern1
    callchannel .pattern4
    callchannel .pattern1
    callchannel .pattern5
    loopchannel 0, .loop

.pattern1:
    ...
    endchannel

.pattern2:
    ...
    endchannel

.pattern3:
    ...
    endchannel

.pattern4:
    ...
    endchannel

.pattern5:
    ...
    endchannel

Actually a very simple mistake, as you can see.

Now I suggest sticky'ing this thread, because I'm sure the solution to this issue will help a lot of people who want to write their own PokeAsm songs.

Last edited by YORAMRW (2016-06-08 17:51:26)


Hacks Gameboy 8-bit music in Pokémon Gen I & II, composes 8-bit music in FamiTracker

Offline

#12 2016-06-09 00:09:11

ShantyTown
Member
Registered: 2013-12-04
Post 301/344

Re: Making a proper GSC PokeAsm song

Hmmm, that shouldn't be necessary (and isn't, in my experience).  Perhaps loopchannel can't be directly preceded by a callchannel?  The way that you settled on isn't ideal because now pattern5 isn't reusable.  For example, what if you wanted to call pattern 5 more than once?

Anyway, glad you found a way to hack around it.

Offline

#13 2016-06-09 19:57:33

YORAMRW
Member
From: The Netherlands
Registered: 2013-03-29
Post 1,164/1,194
Website

Re: Making a proper GSC PokeAsm song

Pattern 5 is indeed not reusable anymore because of the loopchannel command in it. I guess that can be simply fixed by replacing the loopchannel command in the pattern used before looping (pattern 5 in this case) with an endchannel command like in all other patterns, and then making a separate pattern with only the loopchannel command in it to be called at last below the other callchannel commands.

So like this:

.loop
    callchannel .pattern1
    callchannel .pattern2
    callchannel .pattern1
    callchannel .pattern3
    callchannel .pattern1
    callchannel .pattern4
    callchannel .pattern1
    callchannel .pattern5
    callchannel .pattern6

.pattern1:
    ...
    endchannel

.pattern2:
    ...
    endchannel

.pattern3:
    ...
    endchannel

.pattern4:
    ...
    endchannel

.pattern5:
    ...
    endchannel

.pattern6
    loopchannel 0, .loop

Last edited by YORAMRW (2016-06-09 20:01:39)


Hacks Gameboy 8-bit music in Pokémon Gen I & II, composes 8-bit music in FamiTracker

Offline

Board footer

Powered by FluxBB