Path: csiph.com!tncsrv06.tnetconsulting.net!news.uzoreto.com!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Arno Welzel Newsgroups: comp.lang.javascript Subject: Re: Looking for a MIDI file parser acknowledging how broken javascript become. Date: Thu, 14 Nov 2019 08:19:56 +0100 Lines: 77 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: individual.net 9rRObFMK4Ef2x4CQoXxMXAr6RiV9ojGSKx6V+kxEdAd2uSQY2r Cancel-Lock: sha1:mNkV12K8IHdV5cPtT3PgUb6QATs= In-Reply-To: Xref: csiph.com comp.lang.javascript:37904 Jonas Thörnvall: > Den tisdag 12 november 2019 kl. 12:08:47 UTC+1 skrev Arno Welzel: >> On 08.11.19 07:18, Jonas Thörnvall wrote: >> >>> It is a sad story of human stupidity. Basicly a midifile is messages >>> there is timed messages and data messages. The idiots building their >>> parsers using fig lingo. It is fucking tedious implementing parsers, >>> but when the endresult coming out of parser is harder to use then >>> make a parser of ones own, one wonder a bit of the state of matter. >>> >>> How fucking hard can it be to store the messages as strings in an >>> array? The hard part is reading out the fucking files. >> >> Keep in mind that MIDI was introduced more than 35 years ago in August >> 1982. At that time computers (including those in synthesizers) where not >> that powerful and did not have a lot of memory - we talk about >> kilobytes, not megabytes. >> >> Also see: >> >> >> >> >>> Not fucking get them into an array of messages. Each message is >>> simple to parse, no but the fucking monkeys must create objects for >>> this and that, so now i have to make a parser that not made for >>> monkeys playing with figo lingo.... >> What "objects" are you talking about? Is your rant about >> ? >> >> Then go ahead and write your own parser. >> >> >> -- >> Arno Welzel >> https://arnowelzel.de > > Can i ask you Arno is there a simple way to get the objects, stringify them over into an array, or will that require as much work as actaully writing a parser? > > I have find two object oriented midiparsers, but i am simply not the man to read over the even information into an array. I think the actual conversion of delta-time to the absolute time my script use will be no problem, i will figure out in an hour or to. > > But how many rows of code will be needed to stringify the event objects, is it two lines, 10, 100 or 1000? I can't even estimate how hard it will be? > > I am not sure what is meant by using json in your project, is it just an include src or do it need installation? I want my project simple client side script, so nothing beyond a simple include src should be needed. > > It seem most of the parser i found need json, all so what do i need to do? > > https://www.npmjs.com/package/midi-parser-js > https://github.com/Tonejs/Midi > https://github.com/nfroidure/midifile > https://github.com/colxi/midi-parser-js > https://github.com/chrisguttandin/midi-json-parser They do not *need* JSON, these parsers *create* JSON, because JSON *is* the format to store data for JavaScript. JSON = JavaScript Object Notation And don't get confused by "Object" - JSON just represent serialized data which is called "objects" since the data can be accessed using property names. [...] > I guess the disadvantage is if he should remove the code from server, so i guess most people download the necessary files and make a relative path, but then the server somehow must run Json or? > > https://tonejs.github.io/Midi/ No, you just download the stuff, integrate it in your own code and that's it. There is no need for a server. Did you ever use a JavaScript library from others? It seems you don't have any experience at all with this. -- Arno Welzel https://arnowelzel.de