User Tools

Site Tools


fluidcanvas_r2pi:implementing_auto_midi_routing_with_fluidsynth

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
fluidcanvas_r2pi:implementing_auto_midi_routing_with_fluidsynth [2026/03/19 08:15] – created hyjeongfluidcanvas_r2pi:implementing_auto_midi_routing_with_fluidsynth [2026/03/19 08:24] (current) hyjeong
Line 1: Line 1:
 ====== FluidSynth 자동 실행 및 MIDI 오토 라우팅 구현(ALSA-based) ====== ====== FluidSynth 자동 실행 및 MIDI 오토 라우팅 구현(ALSA-based) ======
 +
 +===== 이름을 찾아서 자동 연결 =====
 +
 +MIDI 기기나 FluidSynth 포트 번호는 매번 연결 때마다 달라진다. 따라서 번호 대신 이름으로 찾아서 자동 연결을 시도하는 것이 바람직하다. 
 +
 +<code>
 +fluidsynth ... &
 +
 +# fluidsynth 뜰 때까지 대기
 +until aconnect -l | grep -q "FLUID"; do sleep 0.5; done
 +
 +# 키보드 연결
 +aconnect \
 +$(aconnect -l | grep -A1 "USB" | tail -n1 | awk '{print $1}') \
 +$(aconnect -l | grep -A1 "FLUID" | tail -n1 | awk '{print $1}')
 +</code>
 +
 +===== 스트립트 활용 =====
 +다음을 **start_fluid.sh**라는 이름으로 저장해 두고 실행한다.
  
 <code> <code>
Line 40: Line 59:
   connect_midi   connect_midi
 done done
 +</code>
 +
 +===== systemd 자동 실행 =====
 +/etc/systemd/system/fluid.service
 +<code>
 +[Unit]
 +Description=FluidSynth Auto MIDI
 +After=sound.target
 +
 +[Service]
 +ExecStart=/home/pi/start_fluid.sh
 +Restart=always
 +User=pi
 +
 +[Install]
 +WantedBy=multi-user.target
 +</code>
 +
 +활성화
 +<code>
 +sudo systemctl daemon-reexec
 +sudo systemctl enable fluid
 +sudo systemctl start fluid
 </code> </code>
fluidcanvas_r2pi/implementing_auto_midi_routing_with_fluidsynth.1773875731.txt.gz · Last modified: by hyjeong