# P5js open MIDI file

**URL:** https://discourse.processing.org/t/p5js-open-midi-file/36259
**Category:** Libraries
**Created:** [April 10, 2022, 4:21pm UTC](https://discourse.processing.org/t/p5js-open-midi-file/36259 "2022-04-10T16:21:30Z")
**Posts on this page:** 1
**Showing post:** 3

<div class="post-metadata">

### Author: ![GoToLoop](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/gotoloop/32/86_2.png) [@GoToLoop](https://discourse.processing.org/u/GoToLoop)
#### Post date: [April 10, 2022, 5:07pm UTC](https://discourse.processing.org/t/p5js-open-midi-file/36259/3 "2022-04-10T17:07:43Z")

</div>

> [@patricio1979](#):
>
> Also, is there a way to integrate that typescript library with P5js?

All TS source code is transpiled to JS before it’s able to run on a browser.

Thus they have this CDN link for it posted on their GitHub repo:  
`<script src="https://Unpkg.com/@tonejs/midi"></script>`

You can check its content on this link below:  
[Unpkg.com/browse/@tonejs/midi/](https://Unpkg.com/browse/@tonejs/midi/)

If you prefer you can code in TS in place of JS by installing their package in order to access their “.d.ts” typing files:  
[Unpkg.com/browse/@tonejs/midi/dist/](https://Unpkg.com/browse/@tonejs/midi/dist/)

Also check my previous post about coding in TS w/ p5js along w/ 3rd-party libraries:

> [@Autocomplete and documentation for "imported" p5js](https://discourse.processing.org/t/autocomplete-and-documentation-for-imported-p5js/31927/14):
>
> When we use import in JS 2 things happen: The file becomes a JS module and it needs a \<script type=module\> to load inside the HTML. JS checks the import line if a file w/ that exactly path & name exists so it can load it as a module. As we can note the file “ml-matrix” doesn’t exist. Instead there are “matrix.js” & “matrix.umd.js”. However neither is a JS module but just vanilla JS code. The library’s types is called “matrix.d.ts”. But to make things worse “matrix.umd.js” is exposed as …

---

_[View the full topic](https://discourse.processing.org/t/p5js-open-midi-file/36259)._
