[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [fluid-dev] Dealing with startup
From: |
Josh Green |
Subject: |
Re: [fluid-dev] Dealing with startup |
Date: |
Tue, 14 Oct 2008 09:34:20 -0700 |
Hello Gerald,
On Tue, 2008-10-14 at 11:18 +0100, Edenyard wrote:
> I had the same problem when putting together a system using Fluid and
> Jorgan and I devised a Bash script to make the necessary connections
> after loading Fluid but before loading Jorgan. (I've shown the script
> below between the lines of #####s).
>
> However, although it works, it seems to cause another problem: it seems
> to slow down the loading of my soundfont considerably. I wondered
> whether that was something to do with the testing loop taking up too
> many CPU cycles that should have been used on Fluidsynth's loading. I'm
> not much of a programmer (as my script probably reveals) and I'm
> somewhat stuck to know what the solution is. For now, I've resigned
> myself to accepting the very l-o-n-g SF load time but it would be nice
> to be able to speed it up a bit. For reference, the SF2 file is about
> 275 Mb in size.
>
> Any clues would be very gratefully received. I only just cope with Bash
> scripts so I don't think that I could handle anything of a higher nature!
>
> Cheers,
> Gerald
>
> ##### Script to connect Fluidsynth once it's running ####
>
> #!/bin/bash
> ###
> ### Connect Fluidsynth to VirMIDI.
> ### 7/9/2005.
> ###
> echo "Waiting for Fluidsynth . . ."
> while true
> do
> aconnect -o | grep "Synth input port" > /dev/null
> FINDFLUID=$?
> if [ $FINDFLUID -eq 0 ]
> then
> echo "Fluidsynth running!"
> break
> fi
sleep 0.2
> done
> echo "Connecting Fluidsynth to Virtual MIDI . . ."
> sleep 0.2
> aconnect "Virtual Raw MIDI 1-0":0 FLUID:0
> aconnect "Virtual Raw MIDI 1-1":0 FLUID:1
> aconnect "Virtual Raw MIDI 1-2":0 FLUID:2
> CONNECTFLUID=$?
> if [ $CONNECTFLUID = 0 ]
> then
> echo "Fluidsynth connected!"
> fi
>
>
> #########################################################
>
>
The first "while true" loop is essentially a busy loop, since it will be
executing acconect and checking its value as fast as it can. Adding a
sleep inside of the loop (like I added above), should help things.
Josh