Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
PYHTON not opening files
#1
Hi. 
I have been trying to convert sysex (SYX) files for a Yamaha dx27 synthesizer to another synth format and I found this page:

http://dxconvert.martintarenskeen.nl/

It had links to download the PYTHON files. But i could not get them to open. I keep getting syntax errors when i drag them in. 

Can somebody tell me if these files work or if im doing everything wrong?

My goal is to convert DX27 sysex (SYX files) into Yamaha FB01 sysex. So i can use dx27 patches (sounds) in my FB01

thanks guys.
Reply
#2
It would be helpful if you were to include the OS and Python version you are using. Also, please clarify what you mean by "drag it in".  If you have any relevant code, you should post that as well as the Traceback error.
If it ain't broke, I just haven't gotten to it yet.
OS: Windows 10, openSuse 42.3, freeBSD 11, Raspian "Stretch"
Python 3.6.5, IDE: PyCharm 2018 Community Edition
Reply
#3
Quote:PYHTON not opening files 
How have you been trying to open files?

Assuming the dxconvert.py is what you want....have you read the help?
metulburr@ubuntu:~/Downloads/DXconvert-2.3.2$ python dxconvert.py -h
usage: dxconvert.py [-h] [-bc2at] [-bc] [-b BRIGHTNESS] [-c CHANNEL] [-C] [-d]
                    [-e] [-f STRING] [-fc1] [-fc2] [-mi MID_IN] [-mo MID_OUT]
                    [-m MID] [-n] [-nd] [-nd2] [-ns] [-o OFFSET] [-r] [-sp]
                    [-s RANGE] [-S] [-S2] [--copy X Y] [--swap X Y] [-t] [-v]
                    infile [infile ...] outfile

DXconvert Version: 2.3.2 (20160913)

positional arguments:
  infile                Selects input file(s)
  outfile               Select output file

optional arguments:
  -h, --help            show this help message and exit
  -bc2at, --bc2at       Copy BreathControl data to AfterTouch
  -bc, --bc             Use Breath Controller data
  -b BRIGHTNESS, --brightness BRIGHTNESS
                        Adjust global brightness (+/-)
  -c CHANNEL, --channel CHANNEL
                        Midi channel (1~16) in SysEx header
  -C, --check           Check SysEx checksum before import
  -d, --dx72            Save with AMEM/ACED (DX7II) data
  -e, --endcheck        Check End Of System Exclusive byte (0xF7)
  -f STRING, --find STRING
                        Search for STRING in patchnames
  -fc1, --fc1           Use FC1 foot controller data
  -fc2, --fc2           Use FC2 foot controller data
  -mi MID_IN, --mid_in MID_IN
                        select midiport MID_IN to receive data FROM synth when
                        selecting a .req file
  -mo MID_OUT, --mid_out MID_OUT
                        select midiport MID_OUT to send data TO synth when
                        choosing "MIDI" as outfile
  -m MID, --mid MID     use this option as a shortcut for "--mid_in MID_IN
                        --mid_out MID_OUT", if MID_IN and MID_OUT have the
                        same name MID
  -n, --nosplit         Don't split: save data in one file
  -nd, --nodupes        Remove duplicates
  -nd2, --nodupes2      Remove duplicates, also with different names
  -ns, --nosilence      Remove patches that produce no sound
  -o OFFSET, --offset OFFSET
                        Ignore first/last (+/-) OFFSET bytes in input file(s)
  -r, --random          Renata's Randomizer
  -sp, --split          save each single patch as a separate file
  -s RANGE, --select RANGE
                        Select RANGE to save
  -S, --sort            Sort patches by name, not case-sensitive
  -S2, --sort2          Sort patches by name, case-sensitive
  --copy X Y            Copy patch nr X to nr Y
  --swap X Y            Swap patch nr X and nr Y
  -t, --tx7             Save with TX7 Performance data
  -v, --version         show program's version number and exit
And it looks like each one has a gui version as well. Which has an input/output

   

If thats not related then you need to ask better questions.
Recommended Tutorials:
Reply
#4
os: windows 10
Latest python 

I tried to open 3 ways. same result with the DX titled file as well. For this, I need TX CONVERT. Dragging the actual PY file into the commandline... It actually loads the name on the line when I do that. but i get this:
Python 2.7.12 (v2.7.12:d33e0cf91556, Jun 27 2016, 15:19:22) [MSC v.1500 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> C:\Users\Paulrice\Documents\tx\txconvert1.py
  File "<stdin>", line 1
    C:\Users\Paulrice\Documents\tx\txconvert1.py
     ^
SyntaxError: invalid syntax
>>>
The other way is manually writing open Tx convert.py

same response.

My last way is clicking the actual file icon but the command line pops up for half a sec and goes away.

I'm obviously not a programmer. I only downloaded python just to do this one thing. I have not found the right video tutorial that's specific to what I need. Thats why I came here.

I appreciate the response help. Thank you.
Reply
#5
if you substitute this:
C:\Users\Paulrice\Documents\tx\txconvert1.py
with this:
C:/Users/Paulrice/Documents/tx/txconvert1.py
does that solve the problem?
If it ain't broke, I just haven't gotten to it yet.
OS: Windows 10, openSuse 42.3, freeBSD 11, Raspian "Stretch"
Python 3.6.5, IDE: PyCharm 2018 Community Edition
Reply
#6
hi. I ended up getting another "INVALID SYNTAX"
Reply
#7
Just boink me on the forehead :D

it appears you are try to run txconvert1.py from within the python interpreter, It should be run from the command line I believe. In which case, your original format would be correct.
C:\Users\Paulrice\Documents\tx\txconvert1.py 
If it ain't broke, I just haven't gotten to it yet.
OS: Windows 10, openSuse 42.3, freeBSD 11, Raspian "Stretch"
Python 3.6.5, IDE: PyCharm 2018 Community Edition
Reply
#8
(Sep-24-2016, 06:32 PM)profficial Wrote: Dragging the actual PY file into the commandline
You cant load a file like this. At least not with command prompt and/or python interpreter.
(Sep-24-2016, 06:32 PM)profficial Wrote: txconvert1.py
Are you trying to execute this python script?
Recommended Tutorials:
Reply
#9
(Sep-24-2016, 12:52 AM)metulburr Wrote:
Quote:PYHTON not opening files 
How have you been trying to open files?

Assuming the dxconvert.py is what you want....have you read the help?
metulburr@ubuntu:~/Downloads/DXconvert-2.3.2$ python dxconvert.py -h
usage: dxconvert.py [-h] [-bc2at] [-bc] [-b BRIGHTNESS] [-c CHANNEL] [-C] [-d]
                    [-e] [-f STRING] [-fc1] [-fc2] [-mi MID_IN] [-mo MID_OUT]
                    [-m MID] [-n] [-nd] [-nd2] [-ns] [-o OFFSET] [-r] [-sp]
                    [-s RANGE] [-S] [-S2] [--copy X Y] [--swap X Y] [-t] [-v]
                    infile [infile ...] outfile

DXconvert Version: 2.3.2 (20160913)

positional arguments:
  infile                Selects input file(s)
  outfile               Select output file

optional arguments:
  -h, --help            show this help message and exit
  -bc2at, --bc2at       Copy BreathControl data to AfterTouch
  -bc, --bc             Use Breath Controller data
  -b BRIGHTNESS, --brightness BRIGHTNESS
                        Adjust global brightness (+/-)
  -c CHANNEL, --channel CHANNEL
                        Midi channel (1~16) in SysEx header
  -C, --check           Check SysEx checksum before import
  -d, --dx72            Save with AMEM/ACED (DX7II) data
  -e, --endcheck        Check End Of System Exclusive byte (0xF7)
  -f STRING, --find STRING
                        Search for STRING in patchnames
  -fc1, --fc1           Use FC1 foot controller data
  -fc2, --fc2           Use FC2 foot controller data
  -mi MID_IN, --mid_in MID_IN
                        select midiport MID_IN to receive data FROM synth when
                        selecting a .req file
  -mo MID_OUT, --mid_out MID_OUT
                        select midiport MID_OUT to send data TO synth when
                        choosing "MIDI" as outfile
  -m MID, --mid MID     use this option as a shortcut for "--mid_in MID_IN
                        --mid_out MID_OUT", if MID_IN and MID_OUT have the
                        same name MID
  -n, --nosplit         Don't split: save data in one file
  -nd, --nodupes        Remove duplicates
  -nd2, --nodupes2      Remove duplicates, also with different names
  -ns, --nosilence      Remove patches that produce no sound
  -o OFFSET, --offset OFFSET
                        Ignore first/last (+/-) OFFSET bytes in input file(s)
  -r, --random          Renata's Randomizer
  -sp, --split          save each single patch as a separate file
  -s RANGE, --select RANGE
                        Select RANGE to save
  -S, --sort            Sort patches by name, not case-sensitive
  -S2, --sort2          Sort patches by name, case-sensitive
  --copy X Y            Copy patch nr X to nr Y
  --swap X Y            Swap patch nr X and nr Y
  -t, --tx7             Save with TX7 Performance data
  -v, --version         show program's version number and exit
And it looks like each one has a gui version as well. Which has an input/output



If thats not related then you need to ask better questions.
 i would prefer the GUI. But it does not open
Reply
#10
Open a command prompt (DOS) on windows and insert this command. 


C:\Python27\python.exe C:\Users\Username\Downloads\DXconvert-2.3.2\dxconvert-gui.py
However you need to modify this command to suit your location of python and the file you want to run. Change this path
Quote:
C:\Python27\python.exe
to wherever your python.exe is and change this path

Quote:
C:\Users\Username\Downloads\DXconvert-2.3.2\dxconvert-gui.py

to wherever dxconvert-gui.py source code resides on your computer

http://pythoncentral.io/execute-python-s...ile-shell/
Recommended Tutorials:
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Vlookup function in Pyhton antozas 1 639 Oct-02-2023, 04:16 AM
Last Post: vikraman
  Phyton Opening files on windows C: pc EddieG 3 984 Mar-29-2023, 03:19 PM
Last Post: buran
  Reading Multiple text Files in pyhton Fatim 1 1,914 Jun-25-2021, 01:37 PM
Last Post: deanhystad
  opening files and output of parsing leodavinci1990 4 2,528 Oct-12-2020, 06:52 AM
Last Post: bowlofred
  Opening and closing Mac applications and files Nickd12 5 5,688 Sep-05-2020, 04:39 AM
Last Post: perfringo
  Pyhton code help from head first with python Shaikat_99 3 3,161 Jun-07-2020, 09:12 AM
Last Post: snippsat
  start interactive pyhton shell with pre-loaded custom modules Viktor 2 2,189 Apr-09-2020, 08:25 AM
Last Post: Viktor
  Basic Pyhton for Rhino 6 question about variables SaeedSH 1 2,141 Jan-28-2020, 04:33 AM
Last Post: Larz60+
  Pyhton Coding Help Needed (very small error) friduk 2 2,443 Oct-23-2019, 08:41 AM
Last Post: Gribouillis
  opening a file from a windows desktop folder- error opening file Charan007 1 2,976 Dec-06-2018, 11:50 AM
Last Post: buran

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020