  Game consists of multiple types of content, while the harmony of different
content types play an essential role in game design. However, most works on
procedural content generation consider only one type of content at a time. In
this paper, we propose and formulate online level generation from music, in a
way of matching a level feature to a music feature in real-time, while adapting
to players' play speed. A generic framework named online player-adaptive
procedural content generation via reinforcement learning, OPARL for short, is
built upon the experience-driven reinforcement learning and controllable
reinforcement learning, to enable online level generation from music.
Furthermore, a novel control policy based on local search and k-nearest
neighbours is proposed and integrated into OPARL to control the level generator
considering the play data collected online. Results of simulation-based
experiments show that our implementation of OPARL is competent to generate
playable levels with difficulty degree matched to the ``energy'' dynamic of
music for different artificial players in an online fashion.
