Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Import chords from text/csv #360

Closed
michaelsjackson opened this issue Apr 28, 2023 · 10 comments
Closed

Add Import chords from text/csv #360

michaelsjackson opened this issue Apr 28, 2023 · 10 comments
Labels
enhancement New feature or request
Milestone

Comments

@michaelsjackson
Copy link

... would be cool.
Advantage would be:

  • Take any audio song you like, for example from Youtube.
  • Get its audio into Sonic Visualiser (or sonic-annotator, if you prefer command line tools)
  • Get the recognized chords as text/csv, via the VAMP plugin chordino for Sonic Visualiser
  • Take this text/csv and import directly into JJazzlab
  • Voila, you would expect all chords entered already into JJazzlab, ready for playing and experimenting.

Would be cool if JJazzlab would support this importing feature one day.
Thanks friends.

@michaelsjackson
Copy link
Author

Here is one example of output from a song of reaper forums:
Estimated chords for The Reckoning - Final.mp3, which you can find here, http://forum.cockos.com/showthread.php?t=68410 :

0.000000000 N
0.046439909 C
26.284988662 Fm
27.956825396 C
30.696780045 Caug
32.415056689 C
35.015691609 Fm
35.944489795 Abaug
36.594648526 C
39.381043083 Fm
40.960000000 C
43.746394557 Fm
45.650430839 C
48.111746031 Fm
50.015782312 C
52.477097505 Fm
54.334693877 C
56.610249433 Fm
57.306848072 C7
58.653605442 C
61.718639455 C7
68.870385487 C#6
69.892063492 C7
77.601088435 C#6
78.669206349 Cm7
86.192471655 Ab6
87.585668934 C7
95.016054421 E
95.480453514 C#6
96.084172335 C7
98.406167800 Cm7
112.245260770 Fm
114.242176870 Abaug
115.449614512 C
117.818049886 Caug
120.000725623 Cm
120.883083900 C
126.688072562 Fm
128.174149659 C
131.517823129 C7
137.787210884 Cm7
140.898684807 C7
147.307392290 Bbm7
148.421950113 C7
164.722358276 C#maj7
165.558276643 Fm7
166.487074829 C
174.660498866 Fm
175.775056689 C#m
176.239455782 C
179.118730158 Fm
179.768888888 C#6
180.419047619 C
183.391201814 Caug
185.016598639 C7
187.756553287 Fm
188.546031746 C
196.487256235 Fm
196.998095238 C
200.806167800 G
205.496598639 Ab
207.865034013 Dm7
209.908390022 G
214.273741496 Ab
216.502857142 C#maj7
218.406893424 G
222.911564625 Ab
225.280000000 C#maj7
226.626757369 F
227.601995464 G
231.642267573 Ab
233.917823129 C#maj7
237.122176870 Cm
240.001451247 Fm
243.809523809 C
248.546394557 Fm7
250.450430839 C
253.097505668 Fm
256.394739229 C
257.416417233 Fm
259.181133786 Cm
261.921088435 F
262.385487528 Abmaj7
264.846802721 C
266.286439909 Fm
268.190476190 C
270.605351473 Fm
272.555827664 C
279.428934240 Fm
280.497052154 C#m
281.007891156 C
284.769523809 C#6
285.141043083 C
288.159637188 Caug
289.645714285 C7
292.524988662 Fm
294.382585034 C
296.936780045 Fm
298.469297052 C
301.255691609 Fm
301.766530612 C7
302.323809523 C#m6
302.741768707 C
309.939954648 Fm
311.426031746 C7
314.305306122 Fm
315.652063492 C
318.670657596 Fm
320.017414965 C
323.036009070 Fm
323.500408163 C
327.401360544 Fm
327.912199546 C
331.720272108 Fm
333.020589569 C
336.132063492 Fm
336.642902494 C
342.355011337 N
342.355011337 N

@jjazzboss
Copy link
Owner

What is the number ? Thought it would be the chord position but it seems not...

@michaelsjackson
Copy link
Author

michaelsjackson commented May 4, 2023

Number is time in seconds. However there are other VAMP plugins as well, which could output bar and beat numbers. Or tracking bpm tempo. From all those information, tempo in bpm, time in seconds, bar number beat number, plus the estimated chord, all could be mapped correctly to JJazzlab-X.
If this is interesting for adding to JJazzlab-X, I can investigate more, how it could be done via command line using sonic-annotator. Then as output we would have a few text/csv files for the above parameters, which JJazzlab-X would need to import.

@jjazzboss
Copy link
Owner

If you have a file with bar/beat number on each chord name (ideally + time signature), then adding an importer in JJazzLab is quite easy. You just need to implement this interface: https://github.com/jjazzboss/JJazzLab-X/blob/master/Song/src/org/jjazz/song/spi/SongImporter.java

But problem with automatic chord recognition is that there are always errors (in your file sometimes there are 2 chords in .5 seconds!) and you spend a lot of time fixing the chords...

@michaelsjackson
Copy link
Author

If there would be a CSV song import function, and I would know the required order of columns I could try to create such a CSV via the command line.
Would such a CSV line be enough for example, giving one line (with bpm redundancies).
bar, beat, time_signature, bpm, chord_name
Above example would contain 5 columns. Which is the smallest possible beat distance for entering chords? 1 beat? Or can I also have values like 0.5 beat, or 0.1 beat for example?

Regarding errors, yes, possible, depending on the used song, but still better than nothing. For simple song types it should work quite well I guess. Quick editing for corrections I would find easier than typing all from zero yourself. Using this technique one could do many more quick experiments, mainly, choosing a song you like, then playing along with your real instrument like a guitar for example. You could take any song in the galaxy! :)

@jjazzboss
Copy link
Owner

jjazzboss commented May 18, 2023

To make it simple a csv file is good:
bar, beat, chord_name
Yes beat can be 0 or 1.25 etc.
With this format I can easily make an "import chords" feature: it will just insert the chords in the current song. If a chord is "out of range" (e.g. beyond last song bar, or if the beat position does not match the time signature), I'll issue a warning.

@jjazzboss jjazzboss added this to the 4.0 milestone May 18, 2023
@jjazzboss jjazzboss added the enhancement New feature or request label May 18, 2023
@jjazzboss jjazzboss changed the title Sonic Visualiser vamp plugin chordino recognized chord annotation export text/csv file for importing chords into JJazzlab Add Import chords from text/csv May 18, 2023
@michaelsjackson
Copy link
Author

For 4/4 time signature would not those formula calculate the correct bar and beat values, if you know the constant bpm of the song (assuming the song having constant bpm)?

time_minutes * (bpm/4) = bar
time_minutes * bpm = beat

@jjazzboss
Copy link
Owner

Implemented in 4.0

@michaelsjackson
Copy link
Author

Happy christmas and holidays dear jjazzboss. Thanks for the new version and implementing this feature. Tested it quickly, it seems working. A few observations:
1- When using CSV as coming from sonic-annotator, e.g. Fm shown as "Fm", this will not work. Removing both " solves the situation.
2- When there is no chord in zero position an error message is shown. Holding the tiny symbol at the bottom, pulling it to time zero solves the situation.
3- Having an older linux version e.g. ubuntu 18.04 might only have an older fluidsynth package. Solution is then using the .zip package you gave hopefully. Then I can still continue with my older fluidsynth program (via qsynth for example).
Just tested with one song, but it seems working. Thanks a lot my friend. Have a nice day.

@jjazzboss
Copy link
Owner

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants