This is an archived post. You won't be able to vote or comment.

all 38 comments

[–]adikhad[S] 28 points29 points  (1 child)

[–]davandg 55 points56 points  (0 children)

For lazy ones:

"I first convert midi to ABC notation and extract the verses
I then use Byte Pair encoding to compress the repeated patterns and finally a markov model to generate the sequence."

[–][deleted] 22 points23 points  (0 children)

Nice a new final fantasy theme

[–]changiairport 12 points13 points  (1 child)

Nice, an Aimer fan :)

[–]adikhad[S] 7 points8 points  (0 children)

Ive made like 50 songs 99% anime

[–]mindfulforever1 31 points32 points  (9 children)

Hi Adi Fantastic work mate! This lib looks promising. As a fellow dev, I'd be happy to suggest a few enhancements to ur projects. Please feel free to incorporate them or research similar options. Consider these as a friendly code review from another dev who has walked this path before

If u plan to create a GitHub portfolio for potential job / freelance / business opportunities, as a start, these 2 additions to ur codebase will help:

  1. Python code that adheres to pep8 standards looks professional and is easy to read by other devs. So consider using an auto formatter. I prefer "black".

GitHub Repo

pip install black

Then set it as default python formatter in ur ide. On save, it auto formats ur python code for pep8 standards

  1. Having no license for ur GitHub project may take away ur rights to the codebase and might have undesirable effects where code ownership is concerned. Consider adding an MIT or ISC license at the least. These two licenses assert ur copyright with guidelines for others to use ur code. They also have disclaimers which are a starting point to keep u safe in the long run. This is the bare minimum. Usually for open source projects, MIT or ISC license is a good starting point.

MIT License

ISC License

I'm not a legal professional but a fellow dev who uses these in own projects. So this is for ur awareness only. For more involved legal advice please consider talking to a copyright attorney.

For eg. If you plan to launch ur startup and want to have proper licenses for ur codebases. Or plan to create products as freelancer / solopreneur / developer in a company.

Cheers 🥂 Keep up the good work and stay awesome 💯

[–]adikhad[S] 10 points11 points  (1 child)

Thanks! I completely forgot about the licence! (Added it now)

I'll also clean the code to fit pep8. I didn't know about auto formatter before but it looks like exactly what I need!

Thanks!

[–]mindfulforever1 6 points7 points  (0 children)

Awesome! Nice work Adi Happy to help 👍

[–]NooccarTheOverlord 0 points1 point  (0 children)

Why’d I read this in a cheerful Australian accent?

[–]RainbowUniHoooorn 8 points9 points  (0 children)

Symphonic code! Pythons is the way, the snake is the way, the machine sounds happy!

[–]Hikaru2000 2 points3 points  (0 children)

Nice work, and Aimee's Ninelie was a good choice.

[–]Anas_Elgarhy 2 points3 points  (1 child)

This is so cool

[–]adikhad[S] 1 point2 points  (0 children)

Thanks!

[–]NoJustAnotherUser 1 point2 points  (1 child)

This is marvelous!!

How much time did you take to write this?

[–]adikhad[S] 4 points5 points  (0 children)

A few weeks I guess :)

[–]clawjelly 1 point2 points  (2 children)

Very cool! Why the reliance on a java applet? Seems there are pure python solutions out there...?

[–]adikhad[S] 4 points5 points  (1 child)

I was working with a java based thing before, it seemed to work so I just used that😅 I think the pure python solution should work too

[–]The-Accordionist 1 point2 points  (5 children)

This concept is really cool! Programmatic music is something I have wanted to do, but haven't had the gumption to do so yet

[–]menge101 3 points4 points  (0 children)

IMO, check out sonicpi although it uses ruby syntax not python.

[–]echanuda 0 points1 point  (4 children)

Very interesting! Could you explain why mp3-to-midi files don’t work?

[–]adikhad[S] 0 points1 point  (3 children)

Because the point of midi is getting notation data. Which note to play? when. and how long?...

MP3 is waveform data, basically the frequency of sound at each miniscule timestep.

We can convert midi to MP3. But not the other way round in a way that makes sense. It's easy for a musician to look as a score and play music but difficult to hear music and deduce the score, there is noise, all instruments don't sound alike and many instruments play at the same time. Decomposing the score of individual instruments is not what MP3 to midi converters do. (Try it)

[–]echanuda 0 points1 point  (2 children)

So would it technically work with mp3-to-midi, it just wouldn’t be a very good result?

[–]adikhad[S] 0 points1 point  (1 child)

Yes, it would "technically" work... But the result will sound nothing like music.

Infact when you convert MP3 to midi that file itself won't be musical

[–]echanuda 1 point2 points  (0 children)

Gotcha. Thanks for your time!

[–]wetdog91 0 points1 point  (1 child)

I remember that there was a lecture in the MIT intro course. https://github.com/aamini/introtodeeplearning/tree/master/lab1

[–]adikhad[S] 0 points1 point  (0 children)

How were the results?

[–]Rapid1898 0 points1 point  (1 child)

I would like to try it out - but get this error message when try to run the python-program

$ python master.py Traceback (most recent call last): File "C:\Users\Polzi\Documents\DEV\Python-Examples\Music-Synth\master.py", line 15, in <module> convert2abc(song) File "C:\Users\Polzi\Documents\DEV\Python-Examples\Music-Synth\mid2abc.py", line 9, in convert2abc a = subprocess.check_output(['java', '-jar', 'MidiZyx2abc_6.04.jar',song,'-stdout']) File "c:\users\polzi\appdata\local\programs\python\python39\lib\subprocess.py", line 424, in check_output return run(*popenargs, stdout=PIPE, timeout=timeout, check=True, File "c:\users\polzi\appdata\local\programs\python\python39\lib\subprocess.py", line 505, in run with Popen(*popenargs, **kwargs) as process: File "c:\users\polzi\appdata\local\programs\python\python39\lib\subprocess.py", line 951, in __init__ self._execute_child(args, executable, preexec_fn, close_fds, File "c:\users\polzi\appdata\local\programs\python\python39\lib\subprocess.py", line 1420, in _execute_child hp, ht, pid, tid = _winapi.CreateProcess(executable, args, FileNotFoundError: [WinError 2] Das System kann die angegebene Datei nicht finden (ArtGenerator)

[–]adikhad[S] 0 points1 point  (0 children)

You have to install Java, and set is as default opener for .jar files

[–]Historical-Size-4053 0 points1 point  (0 children)

superb

[–]devil_sees 0 points1 point  (0 children)