nephitejnf / muse2pokecrystal

GNU Affero General Public License v3.0
6 stars 2 forks source link

Custom loops are parsed incorrectly with optimizations #24

Closed hyperdriveguy closed 4 years ago

hyperdriveguy commented 4 years ago

This sometimes can be worked around with the -x parameter. However, I have made an edge case. Lucky me. Flags:

python muse2pokecrystal.py /tmp/He_Approaches.musicxml ../polishedcrystal/audio/music/lookyoungster.asm -c defaultsong.ini -n "Look Youngster" -flCx --noiseless

Configuration (close to default):

[Channel 1]
volume = $77
notetype = $c
intensity = $97
dutycycle = $1
tone =
stereopanning = $0f
vibrato = false
vibrato_delay = $00
vibrato_extent = $00
;custom_commands =

[Channel 2]
notetype = $c
intensity = $a7
dutycycle = $2
tone =
stereopanning = $f0
vibrato = false
vibrato_delay = $00
vibrato_extent = $00
;custom_commands =

[Channel 3]
notetype = $c
intensity = $19
tone =
stereopanning = $ff
vibrato = false
vibrato_delay = $00
vibrato_extent = $00
;custom_commands =

[Channel 4]
notetype = $c
togglenoise = 1
stereopanning = $ff
;custom_commands =

The script output here exhibits issues #22 and #23 as well.

Music_LookYoungster:
    musicheader 3, 1, Music_LookYoungster_Ch1
    musicheader 1, 2, Music_LookYoungster_Ch2
    musicheader 1, 3, Music_LookYoungster_Ch3

Music_LookYoungster_Ch1:
    tempo 320
    volume $77
    notetype $c, $97
    dutycycle $1
    stereopanning $0f
    note __, 8
    note __, 8
    note __, 8
    note __, 8

Music_LookYoungster_Ch1_Loop:
    octave -1
    note __, 8
    note __, 8
    note __, 8
    note __, 8
    octave 3
    note E_, 1
    note E_, 1
    note G_, 1
    note E_, 1
    note A#, 2
    note B_, 2
    note E_, 1
    note E_, 1
    note G_, 1
    note E_, 1
    note A#, 2
    note B_, 2
    note E_, 1
    note E_, 1
    note G_, 1
    note E_, 1
    note A#, 2
    note B_, 2
    octave 4
    note C_, 2
    octave 3
    note B_, 2
    note A#, 2
    note B_, 2
    jumpchannel Music_LookYoungster_Ch1_Loop

Music_LookYoungster_Ch2:
    notetype $c, $a7
    dutycycle $2
    stereopanning $f0
    note __, 8
    note __, 8
    note __, 8
    note __, 8

Music_LookYoungster_Ch2_Loop:
    octave -1
    octave 3
    note B_, 1
    octave 3
    note A#, 1
    octave 3
    note B_, 1
    octave 3
    note A#, 1
    octave 4
    note D_, 1
    note E_, 1
    note D_, 1
    note E_, 1
    octave 3
    note B_, 1
    octave 3
    note A#, 1
    octave 3
    note B_, 1
    octave 3
    note A#, 1
    octave 4
    note D_, 1
    note E_, 1
    note D_, 1
    note E_, 1
    octave 3
    note B_, 1
    octave 3
    note A#, 1
    octave 3
    note B_, 1
    octave 3
    note A#, 1
    octave 4
    note D_, 1
    note E_, 1
    note D_, 1
    note E_, 1
    octave 3
    note G_, 2
    note E_, 2
    note F#, 2
    note E_, 2
    octave 4
    note B_, 1
    octave 4
    note A#, 1
    octave 4
    note B_, 1
    octave 4
    note A#, 1
    octave 5
    note D_, 1
    note E_, 1
    note D_, 1
    note E_, 1
    octave 4
    note B_, 1
    octave 4
    note A#, 1
    octave 4
    note B_, 1
    octave 4
    note A#, 1
    octave 5
    note D_, 1
    note E_, 1
    note D_, 1
    note E_, 1
    octave 4
    note B_, 1
    octave 4
    note A#, 1
    octave 4
    note B_, 1
    octave 4
    note A#, 1
    octave 5
    note D_, 1
    note E_, 1
    note D_, 1
    note E_, 1
    octave 4
    note G_, 2
    note E_, 2
    note F#, 2
    note E_, 2
    jumpchannel Music_LookYoungster_Ch2_Loop

Music_LookYoungster_Ch3:
    notetype $c, $19
    octave 2
    note E_, 1
    note E_, 1
    note G_, 1
    note E_, 1
    note A#, 2
    note B_, 2
    note E_, 1
    note E_, 1
    note G_, 1
    note E_, 1
    note A#, 2
    note B_, 2
    note E_, 1
    note E_, 1
    note G_, 1
    note E_, 1
    note A#, 2
    note B_, 2
    octave 3
    note C_, 2
    octave 2
    note B_, 2
    note A#, 2
    note B_, 2

Music_LookYoungster_Ch3_Loop:
    octave 2
    note E_, 1
    note E_, 1
    note G_, 1
    note E_, 1
    note A#, 2
    note B_, 2
    note E_, 1
    note E_, 1
    note G_, 1
    note E_, 1
    note A#, 2
    note B_, 2
    note E_, 1
    note E_, 1
    note G_, 1
    note E_, 1
    note A#, 2
    note B_, 2
    octave 3
    note C_, 2
    octave 2
    note B_, 2
    note A#, 2
    note B_, 2
    note E_, 1
    note E_, 1
    note G_, 1
    note E_, 1
    note A#, 2
    note B_, 2
    note E_, 1
    note E_, 1
    note G_, 1
    note E_, 1
    note A#, 2
    note B_, 2
    note E_, 1
    note E_, 1
    note G_, 1
    note E_, 1
    note A#, 2
    note B_, 2
    octave 3
    note C_, 2
    octave 2
    note B_, 2
    note A#, 2
    note B_, 2
    jumpchannel Music_LookYoungster_Ch3_Loop

Music_LookYoungster_Ch4:
    notetype $c
    togglenoise 1
    note __, 8
    note __, 8
    note __, 8
    note __, 8

Music_LookYoungster_Ch4_Loop:
    octave -1
    note __, 8
    note __, 8
    note __, 8
    note __, 8
    note __, 8
    note __, 8
    note __, 8
    note __, 8
    jumpchannel Music_LookYoungster_Ch4_Loop

MusicXML: https://cdn.discordapp.com/attachments/706331639650844672/714368456442511410/He_Approaches.musicxml

hyperdriveguy commented 4 years ago

I think the desync was a side effect of the octave -1 this issue fixed itself after fixing #23