Giter Club home page Giter Club logo

luamidi's People

Contributors

pedroalvesv avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

luamidi's Issues

Time seconds per event

It would be great to include a way to easily calculate at what time events are placed instead of deltatime.
Is there a way to do it?

LuaMidi.get_MIDI_tracks does not set duration on NoteEvents

Example program:

local LuaMidi = require ('LuaMidi');

local tracks = LuaMidi.get_MIDI_tracks("tetris.midi");
events = tracks[2]["events"]

for i=2, #events do
	console.log(events[i]:get_duration()); --no return value
end

Tetris.midi in a zip file.

On line 147 of LuaMidi.lua, the event table created for the new NoteEvent doesn't have duration information. I gave a look at raw_note myself but it was tough to determine how to find a duration from that.

I take it what needs to happen is looking at the difference between a NoteOn and NoteOff event, but I'm not familiar enough with the MIDI spec or how the data is being digested to really discern how to figure that information out.

Missing META_PREFIX_PORT event

Crashed because of missing META_PREFIX_PORT event.

I added it to the CONSTANTS:

   META_CUE_POINT         = 0x07,
   META_PREFIX_PORT       = 0x21,
   META_TEMPO_ID          = 0x51,
   META_TIME_SIGNATURE_ID = 0x58,

and

[33]="Prefix Port", [81] = "Tempo",[88] = "Time Signature",[89] = "Key Signature"}

and it moved past that point, but crashed soon thereafter.

Unfortunately, I can't find a good tool to view the actual MIDI file contents and I haven't had time to dig through your code, so I can't offer a suggestion as to what went wrong next.

Sample file request

Hello, do you have any more sample files(just like a whole song)? I want to explore a better writing scheme. If not, I can build one for this project.☺️

get_MIDI_tracks function reported as nil

I'm using Lua 5.4.4. After installing LuaMidi using luarocks, the following script throws an error:

local LuaMidi = require('LuaMidi')
print(LuaMidi.get_MIDI_tracks)
local tracks = LuaMidi.get_MIDI_tracks('./tracks/hot_cross_buns.mid')
print(tracks)

The value of the function LuaMidi.get_MIDI_tracks is printed as nil and an error is thrown.

Elliot@MacBook-Air harp-hero % lua build/import-midi.lua
nil
lua: build/import-midi.lua:3: attempt to call a nil value (field 'get_MIDI_tracks')
stack traceback:
        build/import-midi.lua:3: in main chunk
        [C]: in ?

Not sure what I'm doing wrong here. Unfortunately I couldn't find any examples in the documentation for how to use this function. Any help appreciated!

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.