Comments (8)
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.
And, how to handle overlapped notes?
from symusic.
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.
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.
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.
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.
The only way I think is to raise a warning.
from symusic.
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 inops.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)
- Conversion between ticks and seconds HOT 22
- SoA (Struct of Array) Interface Selection HOT 3
- [Question] Performance improvement compared to mido HOT 4
- Incorrect/inconsistent treatment of program change in dump_midi HOT 9
- Bug when multithreading with macOS since 0.3.4 HOT 14
- Unable to build on linux HOT 10
- Adding a function to easily modify the event times at a score level (like `midi.adjust_times` in PrettyMIDI) HOT 35
- Question and Request: Sorting after conversion to second HOT 5
- Inconsistency between the interface of vector bindings and python list & potential wild pointer problems. HOT 54
- merging tracks HOT 3
- Segmentation Fault when reading Score from MIDI files HOT 3
- Make `Score.clip` include the ongoing tempo/time signature/key signature at `start` HOT 7
- Inconsistency with Score when writing to Audio HOT 11
- MIDI with negative beginning tick HOT 5
- MIDI files with simultaneous note on/off ticks result in incorrect note durations HOT 3
- nanobind v2.0.0 breaks building compatibility HOT 3
- nanobind problem HOT 7
- Suppression of Nanobind leak messages HOT 4
- Set-Tempo events not applied correctly to timestamps in multi-track files HOT 1
- MIDI message level interface design HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from symusic.