크롬북에 music21 넣기
                                            
                                                
                                                
                                                
                                                
                                                
                                                 7857 단어  Chromebookmusic21
                    
Music21이란?
파이썬에서 음악 분석을하기 위해 MIT가 만든 라이브러리입니다.
공식 페이지 : h tp // 우우 b. 미 t. 에즈 / 무시 c21 /
※영어입니다.
MusicXML이라는 악보 데이터를 저장하는 파일을 사용합니다. 또한 lilypond 및 musescore와 같은 악보 편집 소프트웨어를 설치해야합니다.
MusicXML : htps : // 그럼.ぃきぺぢ아. 오 rg / 우키 / 무시 cXML
lilypond 공식 페이지 : htp : // / ly 폰 d. rg/우니 x. 그럼. HTML
musescore 공식 페이지 : h tps : // 무조건 s 이것. 오 rg / 그럼
 환경
pip로 music21 설치
파이썬에 music21을 설치합니다.
pip install music21
python3에 설치되어 있거나 걱정스러운 사람, python3에만 설치하여 메모리를 절약하고 싶은 사람은 여기 :
pip3 install music21
설치되어 있는지 python 인터프리터에서 확인
XXX@penguin:~$ python3 #今回はpython3(どっちでもいいが、、、)
Python 3.5.3 (default, Sep 27 2018, 17:25:39) 
[GCC 6.3.0 20170516] on Linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import music21
>>> #何も出てこなかったらOK
 환경설정-Lilypond 다운로드편
music21은 이대로는 사용할 수 없으므로 환경 설정을 합니다. chromebook(debian)에서의 환경설정을 위해 Windows, Mac의 사람은 다른 사이트를 봐 주세요.
Lilypond 설치 프로그램을 다운로드합니다.
터미널에서
XXX@penguin:~$ wget http://lilypond.org/download/binaries/linux-64/lilypond-2.18.2-1.linux-64.sh
Lilypond 설치
XXX@penguin:~$ sh lilypond-2.18.2-1.linux-64.sh
/home/XXX/에 새로 bin, lilypond 폴더가 있다고 생각합니다.
bin 폴더로 가서 lilypond가 다운로드되었는지 테스트합니다.
XXX@penguin:~$ cd bin
XXX@penguin:~/bin$ ls
abc2ly      etf2ly    lilypond-book           lilypond-wrapper.guile   midi2ly  musicxml2ly
convert-ly  lilypond  lilypond-invoke-editor  lilypond-wrapper.python  mup2ly   uninstall-lilypond
XXX@penguin:~/bin$ sh lilypond
GNU LilyPond 2.18.2
Usage: lilypond [OPTION]... FILE...
Typeset music and/or produce MIDI from FILE.
LilyPond produces beautiful music notation.
For more information, see http://lilypond.org
Options:
  -d, --define-default=SYM[=VAL]      set Scheme option SYM to VAL (default: #t).
                                        Use -dhelp for help.
  -e, --evaluate=EXPR                 evaluate scheme code
  -f, --formats=FORMATs               dump FORMAT,...  Also as separate options:
      --pdf                           generate PDF (default)
      --png                           generate PNG
      --ps                            generate PostScript
  -h, --help                          show this help and exit
  -H, --header=FIELD                  dump header field FIELD to file
                                        named BASENAME.FIELD
  -I, --include=DIR                   add DIR to search path
  -i, --init=FILE                     use FILE as init file
  -j, --jail=USER, GROUP, JAIL, DIR   chroot to JAIL, become USER:GROUP
                                        and cd into DIR
  -l, --loglevel=LOGLEVEL             print log messages according to LOGLEVEL.  Possible values are:
                                        NONE, ERROR, WARNING, BASIC, PROGRESS, INFO (default) and DEBUG.
  -o, --output=FILE                   write output to FILE (suffix will be added)
      --relocate                      relocate using directory of lilypond program
  -s, --silent                        no progress, only error messages (equivalent to loglevel=ERROR)
  -v, --version                       show version number and exit
  -V, --verbose                       be verbose (equivalent to loglevel=DEBUG)
  -w, --warranty                      show warranty and copyright
Report bugs via http://post.gmane.org/post.php?group=gmane.comp.gnu.lilypond.bugs
XXX@penguin:~/bin$ 
오류가 나오지 않으면 정상입니다.
 환경설정-musescore 다운로드편
musescore [.appimage] 파일을 다운로드합니다.
여기를 누르십시오 : h tps : // 무조건 s 이것. 오 rg / 쟈 / 드 w 응 아 d / 무세 s 이것 x86_64. 아피마게
이 파일을 [Linux 파일]로 이동
설치되어 있는지 check!
터미널에서
먼저 .appimage 파일에 실행 권한을 부여합니다.
XXX@penguin:~$ chmod 777 ./MuseScore-3.4.2-x86_64.AppImage
디렉토리는 방금 다운로드한 파일의 디렉토리로 하는 것.
XXX@penguin:~$ ./MuseScore-3.4.2-x86_64.AppImage
그러면...
 
이렇게
 
이런
사용법은 모르겠지만 사용법은 여기를 참조하십시오 : htps://d 루미미코 py. 코 m / 무세 s 이것 /
 환경설정 - music21 편집
python3에서 music21에 lilypond 경로와 musescore 경로를 설정합니다.
settings.pyfrom music21 import *
us = environment.UserSettings()
us.create() # us.create()は最初の一回だけ実行する
us['lilypondPath'] = '/home/XXX/bin/lilypond' # 先程実行したlilypondファイル
us['musescoreDirectPNGPath'] = '/home/XXX/MuseScore-3.4.2-x86_64.AppImage' # 先程実行したmusescoreファイル
us['musicxmlPath'] = '/home/XXX/MuseScore-3.4.2-x86_64.AppImage' # 上と同じ
이제 OK!
 동작 확인
파이썬에서 다음을 실행 :
test.pyfrom music21 import note,stream,corpus,chord,environment,converter,midi
note = note.Note("C4", quarterLength = 1)
note.show()
실행 결과:
 
                
                    
        
    
    
    
    
    
                
                
                
                
                    
                        
                            
                            
                            Reference
                            
                            이 문제에 관하여(크롬북에 music21 넣기), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다
                                
                                https://qiita.com/temps1101/items/f33de282441a1d8bff56
                            
                            
                            
                                텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
                            
                            
                                
                                
                                
                                
                                
                                우수한 개발자 콘텐츠 발견에 전념
                                (Collection and Share based on the CC Protocol.)
                            
                            
                        
                    
                
                
                
            
pip install music21
pip3 install music21
XXX@penguin:~$ python3 #今回はpython3(どっちでもいいが、、、)
Python 3.5.3 (default, Sep 27 2018, 17:25:39) 
[GCC 6.3.0 20170516] on Linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import music21
>>> #何も出てこなかったらOK
music21은 이대로는 사용할 수 없으므로 환경 설정을 합니다. chromebook(debian)에서의 환경설정을 위해 Windows, Mac의 사람은 다른 사이트를 봐 주세요.
Lilypond 설치 프로그램을 다운로드합니다.
터미널에서
XXX@penguin:~$ wget http://lilypond.org/download/binaries/linux-64/lilypond-2.18.2-1.linux-64.sh
Lilypond 설치
XXX@penguin:~$ sh lilypond-2.18.2-1.linux-64.sh
/home/XXX/에 새로 bin, lilypond 폴더가 있다고 생각합니다.
bin 폴더로 가서 lilypond가 다운로드되었는지 테스트합니다.
XXX@penguin:~$ cd bin
XXX@penguin:~/bin$ ls
abc2ly      etf2ly    lilypond-book           lilypond-wrapper.guile   midi2ly  musicxml2ly
convert-ly  lilypond  lilypond-invoke-editor  lilypond-wrapper.python  mup2ly   uninstall-lilypond
XXX@penguin:~/bin$ sh lilypond
GNU LilyPond 2.18.2
Usage: lilypond [OPTION]... FILE...
Typeset music and/or produce MIDI from FILE.
LilyPond produces beautiful music notation.
For more information, see http://lilypond.org
Options:
  -d, --define-default=SYM[=VAL]      set Scheme option SYM to VAL (default: #t).
                                        Use -dhelp for help.
  -e, --evaluate=EXPR                 evaluate scheme code
  -f, --formats=FORMATs               dump FORMAT,...  Also as separate options:
      --pdf                           generate PDF (default)
      --png                           generate PNG
      --ps                            generate PostScript
  -h, --help                          show this help and exit
  -H, --header=FIELD                  dump header field FIELD to file
                                        named BASENAME.FIELD
  -I, --include=DIR                   add DIR to search path
  -i, --init=FILE                     use FILE as init file
  -j, --jail=USER, GROUP, JAIL, DIR   chroot to JAIL, become USER:GROUP
                                        and cd into DIR
  -l, --loglevel=LOGLEVEL             print log messages according to LOGLEVEL.  Possible values are:
                                        NONE, ERROR, WARNING, BASIC, PROGRESS, INFO (default) and DEBUG.
  -o, --output=FILE                   write output to FILE (suffix will be added)
      --relocate                      relocate using directory of lilypond program
  -s, --silent                        no progress, only error messages (equivalent to loglevel=ERROR)
  -v, --version                       show version number and exit
  -V, --verbose                       be verbose (equivalent to loglevel=DEBUG)
  -w, --warranty                      show warranty and copyright
Report bugs via http://post.gmane.org/post.php?group=gmane.comp.gnu.lilypond.bugs
XXX@penguin:~/bin$ 
오류가 나오지 않으면 정상입니다.
환경설정-musescore 다운로드편
musescore [.appimage] 파일을 다운로드합니다.
여기를 누르십시오 : h tps : // 무조건 s 이것. 오 rg / 쟈 / 드 w 응 아 d / 무세 s 이것 x86_64. 아피마게
이 파일을 [Linux 파일]로 이동
설치되어 있는지 check!
터미널에서
먼저 .appimage 파일에 실행 권한을 부여합니다.
XXX@penguin:~$ chmod 777 ./MuseScore-3.4.2-x86_64.AppImage
디렉토리는 방금 다운로드한 파일의 디렉토리로 하는 것.
XXX@penguin:~$ ./MuseScore-3.4.2-x86_64.AppImage
그러면...

이렇게

이런
사용법은 모르겠지만 사용법은 여기를 참조하십시오 : htps://d 루미미코 py. 코 m / 무세 s 이것 /
환경설정 - music21 편집
python3에서 music21에 lilypond 경로와 musescore 경로를 설정합니다.
settings.py
from music21 import *
us = environment.UserSettings()
us.create() # us.create()は最初の一回だけ実行する
us['lilypondPath'] = '/home/XXX/bin/lilypond' # 先程実行したlilypondファイル
us['musescoreDirectPNGPath'] = '/home/XXX/MuseScore-3.4.2-x86_64.AppImage' # 先程実行したmusescoreファイル
us['musicxmlPath'] = '/home/XXX/MuseScore-3.4.2-x86_64.AppImage' # 上と同じ
이제 OK!
동작 확인
파이썬에서 다음을 실행 :
test.pyfrom music21 import note,stream,corpus,chord,environment,converter,midi
note = note.Note("C4", quarterLength = 1)
note.show()
실행 결과:
 
                
                    
        
    
    
    
    
    
                
                
                
                
                    
                        
                            
                            
                            Reference
                            
                            이 문제에 관하여(크롬북에 music21 넣기), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다
                                
                                https://qiita.com/temps1101/items/f33de282441a1d8bff56
                            
                            
                            
                                텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
                            
                            
                                
                                
                                
                                
                                
                                우수한 개발자 콘텐츠 발견에 전념
                                (Collection and Share based on the CC Protocol.)
                            
                            
                        
                    
                
                
                
            
from music21 import note,stream,corpus,chord,environment,converter,midi
note = note.Note("C4", quarterLength = 1)
note.show()
Reference
이 문제에 관하여(크롬북에 music21 넣기), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다 https://qiita.com/temps1101/items/f33de282441a1d8bff56텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
                                
                                
                                
                                
                                
                                우수한 개발자 콘텐츠 발견에 전념
                                (Collection and Share based on the CC Protocol.)