Simplify and edit Frets on Fire (Part 1)

For this project we first need a very simple version of Frets on Fire. We need to implement some kind of  “extremely easy” mode, because we have to test our BCI system for very basic things. For example the real Frets on Fire game uses a pick/rhythm button and up to five melody buttons. We have to disable the rhythm button, because we want to use one input signal from our BCI at once. If we can make this work we can move on.

The thing I have been thinking of is using so called “hammer-ons” or “tappable” notes. Hammer-ons are notes played directly after a strummed or picked note, therefore it doesn’t need to be picked again. If we can make all the notes act as hammer-ons we have eliminated the rhythm button. But how can we do this? We have to dig through the Python code.

After a while I found this in the GuitarScene.py file:


def songLoaded(self, song):

song.difficulty = self.player.difficulty
self.delay += song.info.delay

# If tapping is disabled, remove the tapping indicators

if not self.engine.config.get("game", "tapping"):

for time, event in self.song.track.getAllEvents():

if isinstance(event, Note):event.tappable = False

This code loads the song and its notes. When a note is not tappable they turn it to False and the note has to be picked. If we simply delete this small part of the code (last lines) then all notes will be tappable. We can also change event.tappable from False to True and see if that works.

There are some other lines in this file that could be changed to reach the same result, but we have to test whether it works this way. One problem I for see is that you always have to start with a strummed note before you can hammer-on. I know that because of my experience with the game, of you miss one note, and the next one is a hammer-on, you still have to pick it.

This can be done by changing in the same file this short code:

def keyReleased(self, key):

if self.controls.keyReleased(key) in KEYS and self.song:

# Check whether we can tap the currently required notes

pos   = self.getSongPosition()

notes = self.guitar.getRequiredNotes(self.song, pos)

if self.player.streak > 0 and \

self.guitar.areNotesTappable(notes) and \

self.guitar.controlsMatchNotes(self.controls, notes):

self.doPick()

# Otherwise we end the pick if the notes have been playing long enough

elif self.lastPickPos is not None and pos - self.lastPickPos > self.song.period / 2:

self.endPick()

The thing that is important here is the self.player.streak > 0. This means you have to have a streak of more than 0 hit notes. Else you can’t hammer-on and you have to pick. By simply removing this line you can hammer-on even if you missed the previous note.

Some other things I’ve been thinking about is creating simple songs in Frets on Fire. There is a song editor build in, but it’s not very good, one of the problems is that you can’t create hammer-ons by yourself and that it is frustrating to work with. By importing self-made midi files, Frets on Fire can create the notes for the game. This could be an interesting way to create some easy songs.

The first thing I have to solve is running it on a Linux machine. I’m currently playing Frets on Fire on a Windows machine, the problem here is that the source code is compiled in an other way, all the source files are *.pyd instead of *.py. The *.py files are the real source files, you can edit them if you like, and can be compiled every moment. The *.pyd files can’t be edited easily, these files are comparable to *.DLL files. So, at the moment I can only edit the Linux source, but I can’t play it on a Linux machine, because it gives me problems with OpenGL and some other packages. Hopefully in two weeks I have got another PC with Linux that will be able to play it, so that I can test my modifications!

Advertisement

One Response to “Simplify and edit Frets on Fire (Part 1)”

  1. [...] very difficult with the use of a BCI. I modified the source code in GuitarScene.py, which I showed one of my previous posts. For a detailed report of the changes that I made to the source code, you can send me a message. It [...]

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.