> For the complete documentation index, see [llms.txt](https://docs.songbookplus.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.songbookplus.com/zhong-wen/readme/songtexte-und-akkorde-importieren/aus-midi-dateien.md).

# 从 MIDI 文件中

## 从 MIDI 文件导入歌词和和弦 <a href="#toc165549792" id="toc165549792"></a>

从 MIDI 文件导入歌词的操作与针对 MP3 文件的描述相同 ([从 MP3 文件中](/zhong-wen/readme/songtexte-und-akkorde-importieren/aus-mp3-dateien.md))。

唯一的不同是选择 MIDI 文件时有一个专门的字段。

### 从 Midi 文件格式化歌词

从版本 6.4 开始，SongBook+ 也可以从 Midi 歌词中获取格式化信息。

这不是一个官方标准，而是 SongBook+ 自己定义的格式，借鉴了 ChordPro。

如果这些格式出现在 ChordPro 文件中，SongBook+ 也会在 MIDI 文件中使用。

在 MIDI 歌词中可以插入以下标记，以影响在 SongBook+ 中的显示：

* {color:x}，用于切换到其他颜色
  * 对于 x，可以使用以下颜色之一：red, green, blue, yellow, magenta, cyan, black
  * 除了这些颜色，还可以使用任何颜色的十六进制 RGB 值，格式为 #RRGGBB，例如 #7A67EE
* {bold:on}，用于切换到粗体
* {bold:off}，用于切换到非粗体
* {italic:on}，用于切换到斜体
* {italic:off}，用于切换到非斜体

标记可以作为一个独立的音节插入，或者在现有音节的前面或后面添加，也可以嵌入一个音节的中间。

标记可以在任何地方出现，即使是在文本中间，也可以是多个连续的，它们甚至可以随意嵌套。

**示例:**

```
Hier kommt {color:red}roter Text, {italic:on}dann wird er kursiv, {italic:off}nicht mehr kursiv, {bold:on}dann fett, {italic:on}{color:blue}dann fett und kursiv und in blau,{italic:off}{bold:off}{color:black}dann wieder normal und in schwarz.
```

Hier kommt <mark style="color:red;">roter Text</mark>，*dann wird er kursiv,* nicht mehr kursi&#x76;*,* **dann fett**，*<mark style="color:blue;">**dann fett und kursiv und in blau**</mark>，* dann wieder normal und in schwarz.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.songbookplus.com/zhong-wen/readme/songtexte-und-akkorde-importieren/aus-midi-dateien.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
