miracatici / MakamBox

Culture Specific Analysis Toolbox
http://www.miracatici.com/makambox
GNU General Public License v3.0
3 stars 1 forks source link

Can we use makambox analysis from command line? #1

Closed michaelsjackson closed 4 years ago

michaelsjackson commented 4 years ago

I will try a bit, I hope this is possible, otherwise most practical use case would be excluded. Thanks in advance in case you should have any tips in this direction.

miracatici commented 4 years ago

First of all, I greatly appreciate it; this is my first issue for 5 years :) I tried to seperate (or tried to make coupled loosy) frontend and backend. If you would like to use in command-line, you need to create some scripts that uses backend classes. I didn't developed any ready-to-use command-line tool. You can see all backend classes and functions in src/backEnd and also some useful scripts how to use it in src/test.

michaelsjackson commented 4 years ago

Hey, thanks for the superquick response, I will check them, and in case I have a working technique, I can post it here for other users, in another 5 years maybe, hehe. :)

UPDATE: Looked a bit more, AnalysisForTonic.java in 'analysis' directory seems to do everything already.

I will check other analysis .java files as well, but this seems already promising. I am wondering, why such tools are not externalized for easier use case? Developing something very useful, then letting it die more or less or kept hidden somewhere in src subdirectories in some files, which were used during development. This your supervisor should want normally, but ok. Somehow I do not like scientific projects, which leave out the practical side, like no ready to use command line tool, or solving everything only using Matlab, which no normal human has, except in universities. But recently audio scientific community seems to have switched over to python, which is great. Now anyone can test latest, scientific experiments. This is not a critique of your work, but more to be understood in general, once I wrote a lengthy mail to some genius professor, why they keeping their results not publishing them for everyone... cool professors are replying of course.

michaelsjackson commented 4 years ago

Code below works from inside eclipse, but not when run from command line, have to investigate a bit more. Thanks for your hints above, I can check more of your test examples, if those are working, also from outside of eclipse, because this is my problem now. If your test examples would not run as well, then this means they have same problem.

package analysis;

import applied.SelectCulture; import backEnd.MakamBox; import datas.Culture;

public class AnalysisForTonic2 { public static void main (String[] args){ //System.out.println(System.getProperty("java.class.path")); SelectCulture.setCulture(Culture.deserialize("settings/TurkishExtended.ser")); MakamBox file = null; try { file = new MakamBox(args[0],null); file.createMakam(); System.out.println("File: " + args[0] + " is using makam: " + file.getMakamName() +"\t"+"\t"+ " with tonic: " + file.getTonicHz()); file.killObject(); file = null; } catch (Exception e){ e.printStackTrace(); } } }

Commented out twice in /datas/Culture.java // JOptionPane.showMessageDialog(null, "Culture data file is read"); so the message window does not appear, would be a trouble for a command line use case otherwise.

michaelsjackson commented 4 years ago

Ok, after creating a .jar file, it works also from command line, wonderful. Here my settings for the jar file creation, hint for others in Eclipse: Menu, File, Export, Runnable JAR File, Next, then setting as follows, for example:

screenshot-20200405-193542

Then, in linux, from anywhere on your harddisk you can do something like: for file in /your/music/files/path/*.mp3;do java -jar MakamAnalysis.jar "$file" >> result.txt;done

Also you need to create a directory settings with file inside: TurkishExtended.ser, so these can be used in above AnalysisForTonic2, at least.

Have fun my friends, now, no disturbing message windows, command line, can be applied to any files on your computer great. The fun can begin. Thanks and respects to all who put their energy, skill, efforts, ideas, imagination into building such a useful tool.

One recommendation for analysis, knowing this artist from my university friend from India, great performer, Pandit Bhimsen Joshi: https://www.youtube.com/watch?v=I_QZVQ-3EG8

miracatici commented 4 years ago

Thank you for your contribution. The main purpose of the tool was to create a tool for non-tech musicians/musicologist. It's obvious that very few of them are capable to use command-line or any other UI except GUI :)) That's why command-line tools is not developed. However, of course, I tested all the function from command-line while I was developing. So it can be easily created :) Thanks for comments.

michaelsjackson commented 4 years ago

The main purpose of the tool was to create a tool for non-tech musicians/musicologist.

I see, but I would never exclude command-line use case, so above non-tech musicologists could ignore those, but some might love them, maybe after 5 years or so, one never knows what will come later, being open to all interested is great. Thanks for replying here, I have to investigate later maybe what later scientists did using python jupyter and so on, but now it is not required really, if command line does already all I wanted, makam output, plus tonic.

I love also Tarsos, not TarsosDSP, it is comlementing MakamBox nicely, plus Tony, and you have three great tools, plus maybe sonic-annotator (command line brother of Sonic Visualiser). Did I forget anything which should/could be mentioned here, because it is a too cool tool? (lots of oooo)

Having a command line of Tarsos would be also not bad, mainly for generating .scl files from command line, using some 'working default' parameter values.