Code Monkey home page Code Monkey logo

Comments (3)

gabolsgabs avatar gabolsgabs commented on September 23, 2024

Hello Gaurav,

Thank you for your interest in DALI. About your demand. Yes, it's pretty easy to retrieve the notes information you are asking for. Let's start with the info we have:

entry = dali[uid]  # where uid is a unique id
notes = copy.deepcopy(entry.annotations['annot']['notes'])
print(notes[0])
{'text': 'some text',
 'freq': [523.2511306011972, 523.2511306011972],
 'time': [0.7719999999999999, 1.0719999999999998],
 'index': 0}

The freq key contains the note information in frequency. In the note level you have the same value for the two elements in the list. This is because internally I use a recursive function for transforming the horizontal level to vertical (and viceversa) that requires the same structure for each granularity level. Just take the first one.

If you want to find the musical note just transform the freq into MIDI notes as follow:

 def freq2note(freq):
    return np.round(12 * np.log2(freq/440.) + 69).astype(int)

Here's a example:

for i in notes:
    i['freq'][1] = freq2note(i['freq'][0])  # I stored in the second element in order to keep the vertical2horizontal functionality but feel free to store wherever you want

If you really want the note as you describe ('A', '#A', etc.), just create a hash table with the correlations as in here

Finally, keep in mind that there are some issues with the note information and sometimes they are wrong. We are working to solve these problems and there will be a new version of the dataset with these issues solved soon.

from dali.

Demfier avatar Demfier commented on September 23, 2024

Thank you @gabolsgabs !

from dali.

rynerisraid avatar rynerisraid commented on September 23, 2024

Hi,
Thank you for the wonderful dataset.
I found that the annotatioms of 'notes' missing through entry.annotations['annot']['notes'].
I follow the tutorial, and execute the code to entry.annotations['annot'], then the variable become entry.annotations['annot']['horizontal'], maybe some errors in my codes, could you give the executive processing in details.

Thanks,
Lin

from dali.

Related Issues (9)

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.