Git Product home page Git Product logo

adtlib's People

Contributors

carlsouthall avatar ralic avatar samikshan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

adtlib's Issues

IndexError with some audio clips

Hi there,

Just for some wav files I'm getting the error:

INFO:tensorflow:Restoring parameters from /Users/ignaciot/miniconda3/lib/python3.6/site-packages/ADTLib/files/SnareADTLibAll
INFO:tensorflow:Restoring parameters from /Users/ignaciot/miniconda3/lib/python3.6/site-packages/ADTLib/files/HihatADTLibAll
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/ignaciot/miniconda3/lib/python3.6/site-packages/ADTLib/__init__.py", line 24, in ADT
    Peaks.append(utils.meanPPmm(AFs[j][:,0],PP[j,0],PP[j,1],PP[j,2]))
  File "/Users/ignaciot/miniconda3/lib/python3.6/site-packages/ADTLib/utils/__init__.py", line 44, in meanPPmm
    np.delete(onsets,onsets[i-1+ind])
  File "<__array_function__ internals>", line 6, in delete
  File "/Users/ignaciot/miniconda3/lib/python3.6/site-packages/numpy/lib/function_base.py", line 4406, in delete
    keep[obj,] = False
IndexError: arrays used as indices must be of integer (or boolean) type

Any hints of what might be causing this? These are short clips from songs with a very clearly defined beat pattern.

Input arrays must have same number of dimensions

Thanks for releasing this library!

I was trying it out first with some wave files I had, which gave me no problems. I later tried to convert an mp3 to wav using ffmpeg (mono, 44.1KHz):
ffmpeg -i in.mp3 -acodec pcm_s16le -ac 1 -ar 44100 out.wav

When using default settings I get the following error:

---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
<ipython-input-41-50059aaecf0f> in <module>()
----> 1 out=ADTBDRNN(['/home/cuaras/out.wav'])

/home/cuaras/Documents/workspace/drum/venv/lib/python2.7/site-packages/ADTLib/models/__init__.pyc in ADTBDRNN(TrackNames, out_sort, ret, out_text, savedir, close_error, lambd)
     83             P[j][i]=peak
     84 
---> 85     P=arrange_output(P,output_sort=out_sort)
     86 
     87     if out_text == 'yes':

/home/cuaras/Documents/workspace/drum/venv/lib/python2.7/site-packages/ADTLib/utils/__init__.pyc in arrange_output(Inputs, output_sort)
     44                 Out[i][j][k][1]=Names[j]
     45 
---> 46         Out[i]=np.concatenate([Out[i][0],Out[i][1],Out[i][2]],axis=0)
     47 
     48         if output_sort=='time':

ValueError: all the input arrays must have same number of dimensions

Maybe it's some configuration error on my part. Here is the link to the file:
https://dl.dropboxusercontent.com/u/12497232/out.wav

ValueError: setting an array element with a sequence.

An input of one filename as a singleton list works, but a list of two filenames raises an error.

Good input:

ADTBDRNN(['simple_loop.wav'])

Output:

[array([ 0.        ,  0.04643991,  0.52244898,  0.52244898,  0.98684807,
         0.99845805,  1.04489796,  1.24226757,  1.24226757,  1.30031746,
         1.52090703,  1.52090703,  1.59056689]),
 array(['BD', 'HH', 'SD', 'HH', 'BD', 'HH', 'BD', 'BD', 'HH', 'BD', 'SD',
        'HH', 'HH'], 
       dtype='|S32')]

Good input:

ADTBDRNN(['125_bounce.wav'])

Output:

[array([ 0.49922902,  0.510839  ,  0.58049887,  0.95201814,  0.95201814,
         1.45124717,  1.53251701,  2.31038549,  2.41487528,  2.47292517,
         2.80961451,  3.36689342,  3.44816327,  3.81968254,  3.81968254,
         4.23764172,  4.34213152,  4.42340136,  5.09678005,  5.29414966,
         5.36380952,  6.33904762,  6.6060771 ,  7.0124263 ,  7.05886621,
         7.20979592,  7.27945578,  7.43038549]),
 array(['SD', 'HH', 'HH', 'HH', 'BD', 'SD', 'HH', 'BD', 'SD', 'HH', 'BD',
        'SD', 'HH', 'HH', 'SD', 'BD', 'SD', 'HH', 'BD', 'SD', 'HH', 'HH',
        'BD', 'BD', 'SD', 'SD', 'SD', 'HH'], 
       dtype='|S32')]

Bad Input:

ADTBDRNN(['simple_loop.wav', '125_bounce.wav'])

Output:

---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
<ipython-input-8-88f3a1bbf5de> in <module>()
----> 1 ADTBDRNN(['simple_loop.wav', '125_bounce.wav'])

/Library/Python/2.7/site-packages/ADTLib/models/__init__.pyc in ADTBDRNN(TrackNames, out_sort, ret, out_text, savedir, close_error, lambd)
     85             P[j][i]=peak
     86 
---> 87     P=arrange_output(P,output_sort=out_sort)
     88 
     89     if out_text == 'yes':

/Library/Python/2.7/site-packages/ADTLib/utils/__init__.pyc in arrange_output(Inputs, output_sort)
     40 
     41         Out[i]=list(np.zeros(len(Inputs[i])))
---> 42         Out1[i]=list(np.zeros((1,2)))
     43         for j in xrange(len(Inputs[i])):
     44             Out[i][j]=list(np.zeros((len(Inputs[i][j]))))

ValueError: setting an array element with a sequence.

Only half of the song is processed?

Hi Carl,
I was trying to run your algo on couple of songs but I've noticed whatever I pass as input I will always get only half of the song processed. For instance if I pass 20 seconds in input I can see only BD, SD and HH up to 10 seconds same if I double those values. Any idea of why this might be happening?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.