sorting in js » Branding i identyfikacja wizualna » Forum
Forum

Forum



ПоискПоиск   Users   Rejestracja   Wejście
Dzisiaj: 02.04.2025 - 05:23:35
Strony:  1  2  

sorting in js

Ogłoszenie

.
AutorWiadomość

Kryterium0

users




Statystyka:
Wiadomości: 1612
Rejestracja: 21 lip 2006, 23:08

suggestions for sorting algorithm suitable for sorting midi events? for sample accurate communication and handling and automation in a set of plugins i'm working on (speech synth), i need to make sure the incoming midi events (in @block) are sorted by increasing offsets (so that i can handle one by one, and count down a samples_until_next_midi_event variable). after some experimentation, i've seen that if you play realtime midi keys/knobs, and have some other plugins sending midi messages, and also incoming midi from some sequencer items, all at the same time, the midi messages you get with midirecv() aren't always sorted properly by. so, it seems like i need to do the sorting myself... any ideas of what kind of algorithm would work best, considering both cpu use, and the limitations of the js language (pointers, lists, buffers, ..)?

---------------------
Wiadomość # 1 31.01.21 - 23:12:13
RE: sorting in js

Fan Polsat Fun HD

users




Statystyka:
Wiadomości: 152
Rejestracja: 22 lut 2021, 14:50

insertion sort 

---------------------
Pozdrawia Fan Polsat Fun HD! [br]
Wiadomość # 2 31.01.21 - 23:16:00
RE: sorting in js



users




Statystyka:
Wiadomości:
Rejestracja:

---------------------
Wiadomość # 3 dzisiaj o godz 05:23
RE: sorting in js



users




Statystyka:
Wiadomości:
Rejestracja:

---------------------
Wiadomość # 5 dzisiaj o godz 05:23
RE: sorting in js

Semih

users




Statystyka:
Wiadomości: 13
Rejestracja: 07 sie 2009, 8:12

i'm answering myself here, well, well. anyway... trying to convert something i found here: Code:

---------------------
Wiadomość # 6 31.01.21 - 23:27:15
RE: sorting in js

patka-wariatka

users




Statystyka:
Wiadomości: 5
Rejestracja: 26 lis 2006, 19:40

Suppose we should make it just qsort() the input... it should really qsort the output anyway, so maybe you should just try putting a js midi passthru and see if that gets it sorted? A good algorithm, since you lack functions for recursion, and since you are doing offsets of integers and limited range, might be a radix sort. -Justin

---------------------
Wiadomość # 7 31.01.21 - 23:38:07
RE: sorting in js

Kiełbasa

users




Statystyka:
Wiadomości: 30
Rejestracja: 10 maja 2009, 11:02

And don't forget to invert the free radical quantum field permeating the intermavermirator valve. D PS :D

---------------------
Wiadomość # 8 31.01.21 - 23:44:04
RE: sorting in js

marta11654

users




Statystyka:
Wiadomości: 197
Rejestracja: 20 kwie 2019, 14:26

sort-test 

---------------------
Wiadomość # 9 31.01.21 - 23:51:55
RE: sorting in js

Blank

users




Statystyka:
Wiadomości: 2396
Rejestracja: 05 lip 2008, 13:22

i used this small js-thing for experimentation and checking the midi event offsets.. the (normally black) gfx area flashes red for a moment if the events for the current block is _not_ sorted by offset properly. or, actually, when any of the midi events have an offset which is smaller than any of the previous events in the block.. i have a track playing with an item full of midi notes, and at the same time hammer away on an external midi keyboard, and also, at the same time another track which is sending midi events to this track.. seems like (especially) the realtime midi keyboard events are not sorted in with the rest, but appended to the end of the list of events... so, again, will the midi events be sorted by reaper in the future, will there be a kind of sort_events() function in js, or should i still do the sorting myself for plugins where the order is really important? if not, there could be conflicts, note off coming in before note on, etc... or i could check every single event for every sample or every block i process, which could be quite inefficient in some situations, with lots of events, very-very small note length, etc, ... Code:

---------------------
Wiadomość # 10 01.02.21 - 00:02:13
RE: sorting in js
First note of midi track not playing : Poprzedni tematNastępny temat: Best SVCD Authoring Software
Strony:  1  2  

Administrator zabronił gościom odpowiadać na wiadomości! Aby się zarejestrować, kliknij link: rejestr


Uczestnicy