Giter Club home page Giter Club logo

Comments (8)

Yikai-Liao avatar Yikai-Liao commented on July 18, 2024 1

filter_notes is for Score and Track (not for piano roll), it is implemented in some older versions and removed for some reasons that I have forgotten. It will be reimplemented in future versions.

from symusic.

lzqlzzq avatar lzqlzzq commented on July 18, 2024

And, how to handle overlapped notes?

from symusic.

Natooz avatar Natooz commented on July 18, 2024

I think these are good directions! I agree that it is better to leave to the user the task to use the "MIDI-level" resampling methods.

filter_notes would be a function given by the user?

For overlapping notes, we can either:

  • not bothering with them, that would in practice merge them into one;
  • insert a "pause" tick between them to mark the separation (trimming the offset/duration of the first note).

Ideally, this could be given as an option to the user.

Also pypianoroll (and muspy?) has nice visualisation methods. Do you think it could be worth adding similar features in symusic?

from symusic.

Yikai-Liao avatar Yikai-Liao commented on July 18, 2024

filter_notes will be added, which accepts a python function, like a lambda funciton. But just like using python lambda funciton in sort, don't expect it to be as fast as native c++ code.

For the pause token, do you mean this kind of things :

Note(start=0, duration=2, pitch=60) Note(start=2, duration=2, pitch=60)

  • without pause [1, 1, 1, 1]
  • with pause [1, 0, 1, 1]

Visualization part would be hard in cpp part. And I think it would better to reuse the code in pypianoroll (using matplotlib) to create such image. To be honest, we don't need to take care of the performance of visualization part.

Further, I think it would be better to add a install option for visualization like pip install symusic[visualizaiton] and pip install symusic[all]. Because many people just never use this part (visualization) and matloplib is large.

from symusic.

Natooz avatar Natooz commented on July 18, 2024

You got it right for the pause ticks.

I agree with you for everything for the visualisation. It's indeed a part used only by a small proportion of users. (I was just asking out of curiosity, not recommending or asking for anything, thought you might be interested)

For filter_notes, maybe I'm missing something, but if the piano roll method receives a Score or Track object and this function, why not just letting the user filter the Score/Track himself with his own method before calling the piano roll method?

from symusic.

lzqlzzq avatar lzqlzzq commented on July 18, 2024

I am implementing the pianoroll feature. Because the de-overlap operation is a little complicated and seems to be a useful tool even without the pianoroll, I plan to put it in ops.h.
And, how to handle the following situation if a "pause" tick must be added?

Note(start=0, duration=1, pitch=60) Note(start=1, duration=2, pitch=60)

The first note cannot be ignored, and shifting the start of a note seems to change the semantics.

from symusic.

lzqlzzq avatar lzqlzzq commented on July 18, 2024

The only way I think is to raise a warning.

from symusic.

Yikai-Liao avatar Yikai-Liao commented on July 18, 2024

I am implementing the pianoroll feature. Because the de-overlap operation is a little complicated and seems to be a useful tool even without the pianoroll, I plan to put it in ops.h. And, how to handle the following situation if a "pause" tick must be added?

Note(start=0, duration=1, pitch=60) Note(start=1, duration=2, pitch=60)

The first note cannot be ignored, and shifting the start of a note seems to change the semantics.

In my opinion, pause could only be used when ticks_per_quarter is large, which means the situation where duration=1 would be rare, and reduce the duration by 1 tick won't change the semantics too much.

When we need to use a "strong quantization" for creating pianoroll, the best way to deal with this kind of situation should be using onset pianoroll with frame pianoroll or offset pianoroll at the same time. For example, just put two kind of pianoroll in two distinct channels (this refers to the concept of channel in the images), and input them together into a model (e.g. CNN)

BTW, the example is actually not de-overlap, it is de-adjacentize (or de-adj for short)

This is the situation for de-overlap:
Note(start=0, duration=2, pitch=60) Note(start=2, duration=2, pitch=60)

from symusic.

Related Issues (20)

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.