leonawicz / tabr

R package: tabr. Notation-based and tidy music data analysis and transcription.
https://leonawicz.github.io/tabr/
Other
127 stars 10 forks source link

macOS: unable to open #28

Closed koaning closed 4 years ago

koaning commented 4 years ago

This package sounds amazing, which is why it's unfortunate that I hit a breaking bug.

When running this example my instance of Rstudio seems to have issues with rendering. Apon rending the cell in the RMD or after knitting I keep getting this error.

image

Any idea what might be prompting this?

koaning commented 4 years ago

This is the output from the Rmd cell.

Rendering: /Users/user/Development/radix-koaning-blog/tabs.Rmd
  |........                                                              |  11%
  ordinary text without R code

  |................                                                      |  22%
label: setup (with options) 
List of 2
 $ include: logi FALSE
 $ indent : chr "  "

  |.......................                                               |  33%
  ordinary text without R code

  |...............................                                       |  44%
label: general
  |.......................................                               |  56%
  ordinary text without R code

  |...............................................                       |  67%
label: music (with options) 
List of 2
 $ fig.width : num 10
 $ fig.height: num 3.5

Processing `/var/folders/1_/2ztt9v0x327grgr2914hj31w0000gn/T//RtmpEOgRdp/file228342049b51.ly'
Parsing...
warning: systems run off the page due to improper paper settings, setting default values
Interpreting music...
warning: no music found in score
Success: compilation successfully completed

Error in png::readPNG(file) : 
  unable to open /var/folders/1_/2ztt9v0x327grgr2914hj31w0000gn/T//RtmpEOgRdp/file228342049b51.png
Calls: <Anonymous> ... <Anonymous> -> plot_music_guitar -> .draw_image -> <Anonymous>
Execution halted
leonawicz commented 4 years ago

Please provide the output from sessionInfo(). Are you using v0.4.1 (development version) as indicated in the gist title? The version fixes some bugs related to use of more than one label.

koaning commented 4 years ago

My bad! I just added the new version. Here's the info.

> sessionInfo()
R version 3.6.1 (2019-07-05)
Platform: x86_64-apple-darwin15.6.0 (64-bit)
Running under: macOS High Sierra 10.13.6

Matrix products: default
BLAS:   /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/3.6/Resources/lib/libRlapack.dylib

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods  
[7] base     

other attached packages:
[1] tabr_0.4.1

loaded via a namespace (and not attached):
 [1] Rcpp_1.0.3       png_0.1-7        crayon_1.3.4    
 [4] digest_0.6.23    dplyr_0.8.3      assertthat_0.2.1
 [7] R6_2.4.1         magrittr_1.5     evaluate_0.14   
[10] pillar_1.4.2     rlang_0.4.2      rstudioapi_0.10 
[13] rmarkdown_1.18   tools_3.6.1      glue_1.3.1      
[16] purrr_0.3.3      xfun_0.11        yaml_2.2.0      
[19] compiler_3.6.1   pkgconfig_2.0.3  radix_0.6       
[22] htmltools_0.4.0  tidyselect_0.2.5 knitr_1.26      
[25] tibble_2.1.3

I now seem to get this message:

Processing `/var/folders/1_/2ztt9v0x327grgr2914hj31w0000gn/T//RtmpbZaEH5/file3f30417e923d.ly'
Parsing...
warning: systems run off the page due to improper paper settings, setting default values
Interpreting music...
Preprocessing graphical objects...
Finding the ideal number of pages...
Fitting music on 1 page...
Drawing systems...
Layout output to `/var/folders/1_/2ztt9v0x327grgr2914hj31w0000gn/T//RtmpbZaEH5/file3f30417e923d.eps'...
Converting to PNG...
dyld: Library not loaded: ./bin/../sobin/libgs.8.70.dylib
  Referenced from: /Applications/LilyPond.app/Contents/Resources/bin/../bin/gs
  Reason: image not found

fatal error: GS exited with status: 6
Quitting from lines 35-40 (tabs.Rmd) 
Error in png::readPNG(file) : 
  unable to open /var/folders/1_/2ztt9v0x327grgr2914hj31w0000gn/T//RtmpbZaEH5/file3f30417e923d.png
Calls: <Anonymous> ... <Anonymous> -> plot_music_guitar -> .draw_image -> <Anonymous>
Execution halted
leonawicz commented 4 years ago

I'm not sure what's happening there. Clearly you are successfully calling LilyPond from R on Mac, which is something that others have not been able to do (#11). On the other hand, I don't know why it complains about the paper settings; you could try playing around with those. But whatever is the case, it seems LilyPond is failing to make the png file, just guessing here. As mentioned in the linked issue, I really can't offer support for Mac myself. Other Mac users will have to chime in.

I can only recommend to try the most basic examples using lilypond() and tab() such as seen in the README here on GitHub. If you have trouble with simpler, more direct use of LilyPond from R, it would not be very helpful to focus on this gist example, which has more complexities going on behind the scenes. I'll close this issue, but please put any additional Mac problems in the linked issue.

I've also seen references to LilyPond possibly not being supported on OSX in the future [1], [2]. But I don't know how serious or current that is. I can't say I blame the open source developers though. Hopefully some other Mac users can offer solutions there and here in the future.