0

I am trying to run this ruby package that will convert sf2 files to midijs. I'm more of a front end guy and I'm trying to wrap my head around running ruby in windows.

https://github.com/eagsalazar/sf2_to_js

I have ruby & the devkit installed on my machine, I am able to install gems successfully. Now I'm running into an error when I try to run this command:

c:\sf2\bin> sf2_to_js to_js JV1080.sf2 -o drumMachine

This is the error I get. I think somehow I don't have the fluidsynth installed correct, right?

c:\sf2\bin>sf2_to_js to_js JV1080.sf2 -o drumMachine
DL is deprecated, please use Fiddle
C:/Ruby200/lib/ruby/gems/2.0.0/gems/sf2_to_js-0.0.3/lib/sf2_to_js.rb:26:in ``':
No such file or directory - which fluidsynth (Errno::ENOENT)
        from C:/Ruby200/lib/ruby/gems/2.0.0/gems/sf2_to_js-0.0.3/lib/sf2_to_js.r
b:26:in `check_deps'
        from C:/Ruby200/lib/ruby/gems/2.0.0/gems/sf2_to_js-0.0.3/lib/sf2_to_js.r
b:18:in `initialize'
        from C:/Ruby200/lib/ruby/gems/2.0.0/gems/sf2_to_js-0.0.3/bin/sf2_to_js:1
5:in `new'
        from C:/Ruby200/lib/ruby/gems/2.0.0/gems/sf2_to_js-0.0.3/bin/sf2_to_js:1
5:in `to_js'
        from C:/Ruby200/lib/ruby/gems/2.0.0/gems/thor-0.19.1/lib/thor/command.rb
:27:in `run'
        from C:/Ruby200/lib/ruby/gems/2.0.0/gems/thor-0.19.1/lib/thor/invocation
.rb:126:in `invoke_command'
        from C:/Ruby200/lib/ruby/gems/2.0.0/gems/thor-0.19.1/lib/thor.rb:359:in
`dispatch'
        from C:/Ruby200/lib/ruby/gems/2.0.0/gems/thor-0.19.1/lib/thor/base.rb:44
0:in `start'
        from C:/Ruby200/lib/ruby/gems/2.0.0/gems/sf2_to_js-0.0.3/bin/sf2_to_js:2
1:in `<top (required)>'
        from C:/Ruby200/bin/sf2_to_js:23:in `load'
        from C:/Ruby200/bin/sf2_to_js:23:in `<main>'

I am a total Ruby noob and have no idea what I'm doing. Any help is greatly appreciated.

This is the error I'm seeing on OSX 10.9:

Mikes-MacBook-Pro:bin mike$ sudo sf2_to_js to_js ~/Downloads/JV1080.sf2 -o ~/Downloads/
/usr/bin/sf2_to_js:19:in `load': /Library/Ruby/Gems/1.8/gems/sf2_to_js-0.0.3/bin/sf2_to_js:10: syntax error, unexpected ':', expecting kEND (SyntaxError)
...d_option :output_dir, aliases: '-o', desc: "output directory...
                              ^
/Library/Ruby/Gems/1.8/gems/sf2_to_js-0.0.3/bin/sf2_to_js:10: syntax error, unexpected ',', expecting kEND
...on :output_dir, aliases: '-o', desc: "output directory", def...
                              ^
/Library/Ruby/Gems/1.8/gems/sf2_to_js-0.0.3/bin/sf2_to_js:10: syntax error, unexpected ',', expecting kEND
...-o', desc: "output directory", default: "./soundfonts/"
                              ^
/Library/Ruby/Gems/1.8/gems/sf2_to_js-0.0.3/bin/sf2_to_js:11: syntax error, unexpected ':', expecting kEND
...tion :instrument_ids, aliases: '-i', desc: "array of instrum...
                              ^
/Library/Ruby/Gems/1.8/gems/sf2_to_js-0.0.3/bin/sf2_to_js:11: syntax error, unexpected ',', expecting kEND
...instrument_ids, aliases: '-i', desc: "array of instrument id...
                              ^
/Library/Ruby/Gems/1.8/gems/sf2_to_js-0.0.3/bin/sf2_to_js:11: syntax error, unexpected ',', expecting kEND
... ids to build instead of all", type: :array, default: []
user547794
  • 12,873
  • 32
  • 97
  • 147

1 Answers1

1

The gem uses both fluidsynth and oggenc, so you'll need those. However, the gem still won't work on Windows because of this part of the code:

def check_deps
  raise 'missing fluidsynth (brew install fluidsynth)' unless `which fluidsynth`
  raise 'missing oggenc (brew install fluidsynth)' unless `which oggenc`
end

That would need to be modified to use where.exe on Windows at the very least.

Community
  • 1
  • 1
threedaymonk
  • 475
  • 3
  • 4
  • I do have access to a mac (OSX 10.9), but I'm having errors running it there too. I'll update my response - does this error make any sense? – user547794 Sep 07 '14 at 14:26
  • @user547794 Your problem on OS X is that you're using Ruby 1.8, but `sf2_to_js` uses syntax that only works in Ruby 1.9 and later. – threedaymonk Sep 07 '14 at 18:02