Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/ivan-1f/phichain/llms.txt

Use this file to discover all available pages before exploring further.

Overview

Notes are the gameplay elements that players interact with. Phichain supports four note types: Tap, Hold, Flick, and Drag.

Types

Note

The main note type containing all note properties.
kind
NoteKind
required
The type of note (Tap, Hold, Flick, or Drag)
above
bool
required
Whether the note appears above (true) or below (false) the judgment line
beat
Beat
required
The beat position when the note should be hit
x
f32
required
Horizontal position relative to the line center (-1.0 to 1.0 typically)
speed
f32
required
Speed multiplier for this note (1.0 = normal speed)

NoteKind

The type of note, each with different gameplay mechanics.

Creating Notes

use phichain_chart::note::{Note, NoteKind};
use phichain_chart::beat::Beat;

let tap = Note::new(
    NoteKind::Tap,
    true,              // above the line
    Beat::from(2.0),   // at beat 2
    0.5,               // x position
    1.0,               // normal speed
);

Working with Notes

let note = Note::new(NoteKind::Tap, true, Beat::ZERO, 0.0, 1.0);

if note.kind.is_tap() {
    println!("This is a tap note");
}

if note.kind.is_hold() {
    println!("This is a hold note");
}

if note.kind.is_flick() {
    println!("This is a flick note");
}

if note.kind.is_drag() {
    println!("This is a drag note");
}

JSON Serialization

{
  "kind": "tap",
  "above": true,
  "beat": [2, 0, 1],
  "x": 0.5,
  "speed": 1.0
}

Note Properties Explained

Position (x)

The horizontal position along the judgment line:
  • 0.0 = center of the line
  • Positive values = right side
  • Negative values = left side
  • Typical range: -1.0 to 1.0, but can go beyond

Above/Below

Determines which side of the judgment line the note appears on:
  • true = above the line (notes fall down)
  • false = below the line (notes rise up)

Speed

Multiplies the note’s approach speed:
  • 1.0 = normal speed (affected by line speed events)
  • > 1.0 = faster approach
  • < 1.0 = slower approach
  • 0.5 = half speed (appears to move slowly)
  • 2.0 = double speed (appears to move quickly)

Beat Position

Notes use the beat system with [beat, numerator, denominator] format (e.g., [0, 1, 4] for first quarter note). Notes are ordered by their beat position.

Examples

// Create a stream of tap notes
let mut notes = Vec::new();
for i in 0..8 {
    notes.push(Note::new(
        NoteKind::Tap,
        true,
        Beat::from(i as f32),
        0.0,
        1.0,
    ));
}

Notes

  • Hold notes are the only note type with additional state (hold_beat)
  • For non-hold notes, end_beat() returns the same value as beat
  • Notes are sorted by beat position when needed
  • Speed only affects visual approach, not timing

Build docs developers (and LLMs) love