-
Notifications
You must be signed in to change notification settings - Fork 6
Note Iterators
- Read about how to do basic notemods before continuing.
Note iterators are designed to run notes through a sequence of "conditions" and "processes" in order to modularly create notemod effects that would normally have to be written with a direct for loop.
rm.noteIterator()
.betweenTime(0, 20)
.betweenXPositions(0, 2)
.addTrack('myNote')
.run(map)- Note: this is equivalent to:
map.allNotes.forEach(note => {
const inTime = note.beat >= 0 && note.beat < 20
const inPosition = note.x >= 0 && note.x < 2
if (inTime && inPosition) {
note.track.add('myNote')
}
})When the run function is called on a note iterator, it will run all of the conditions on every note in the provided difficulty. Based on whatever notes pass all of the conditions, all of the processes will then be run on each one.
There are lots of provided conditions (example: betweenTime) and processes (example: addTrack) but you can also add your own.
rm.noteIterator()
.addCondition(note => {
return note.beat < 20
})
.addProcess(note => {
note.beat += 1
})
.run(map)- The
addConditionfunction accepts a function parameter that takes in a note and returns true or false. It adds this function to it's internalconditions. - The
addProcessfunction accepts a function parameter that takes in a note and returns nothing. It adds this function to it's internalprocesses.
You can process an array of notes through a note iterator with the processNotes function.
rm.noteIterator()
.addTrack('myNotesTrack')
.processNotes(myNotes)Note iterators work with all note types by default. If you wish to only filter a certain type of notes, you can use the onlyArcs, onlyBombs, onlyChains, onlyColorNotes, and setTypeFilter functions.
rm.noteIterator()
.onlyArcs()
.addTrack('myArc')
.run(map)The code snippet above will allow only arcs to pass. But on top of that, it also types the entire class so that all conditions and processes only operate on Arcs.

If you wish to filter more than one type of note, the setTypeFilter function will allow you to pass an array of strings to represent each note type you want.
rm.noteIterator()
.setTypeFilter(['Arc', 'Bomb'])
.run(map) // only runs on Arcs and Bombs.- Info
- Difficulty
- Beatmap Objects
- Gameplay Objects
- Walls
- Basic Notemods
- Note Iterators
- Basic Events
- V3 Events
- Custom Events
- Heck Tracks and Animation
- Easings
- Point Types
- Point Utilities
- Heck Animation Baking
- Heck Animation Settings
Non-Vivify Models
Vivify