Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tempo and Play (and possibly others) need a better way of executing the instructions #1

Open
kitlith opened this issue Aug 25, 2020 · 2 comments

Comments

@kitlith
Copy link
Owner

kitlith commented Aug 25, 2020

tempo goes through the instructions in physical order, which is an issue when the tempo instruction is only in a single track and it's not the first track. It would help if it took an approach closer to play, following control flow.

play follows control flow, but it goes through each track in turn instead of following strict temporal order, which would be preferred for accurate emulation of some aspects of rseq.

The end goal for this issue would be to produce a single player that could be used for both purposes, and possibly others in the future.

@kitlith
Copy link
Owner Author

kitlith commented Aug 25, 2020

A workaround for the issue in tempo if you come across it is to add/move the tempo instruction to before any notes or rests physically occur in the file. An example disassembly:

SMF_Fire_Burning_Begin:
set TrackUsage = 15
SMF_Fire_Burning_Start:
fork 1, SMF_Fire_Burning_Track_1
fork 2, SMF_Fire_Burning_Track_2
fork 3, SMF_Fire_Burning_Track_3
SMF_Fire_Burning_Track_0:
set Polyphony = 0
set Instrument = 60

// to workaround, place `set Tempo = <correct value>` anywhere before here
rest 24 // tempo is erroring *here*, because no tempo instruction is physically located before it.
note 61, 127, 24
rest 24
note 61, 127, 12
rest 12
note 61, 127, 12

// ...

SMF_Fire_Burning_Track_2:
set Polyphony = 0
set Tempo = 120 // correct Tempo value, but located way after notes and rests are first used physically. temporally, though, it's in the right spot.
end_track

// ...

@kitlith
Copy link
Owner Author

kitlith commented Nov 12, 2020

for tempo, it may also help if something paid attention to control flow and took note of tracks, functions, and loops.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant