Giter VIP home page Giter VIP logo

midiex's People

Contributors

haubie avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

willemodendaal

midiex's Issues

Ableton doesn't "do" anything when I send it the following notes.

Such an exciting project! Very keen to use Elixir to do some midi things.

I'm sure it's me doing something wrong, not Ableton, just not sure what... (First time generating midi with code)

When I run the following code, I can see that Ableton is receiving something (top right flashing icon while this code runs).

But I can't get Ableton to play (monitor) or record midi notes. I think I've done the necessary configuration, including selecting the appropriate midi "device" that has the expected name I gave to it. The midi track plays fine if I test with the computer keyboard.

Is there something obviously wrong with the code below? Intended to play middle-C for as long as the program runs (toggling every 250ms):

  def testing_testing_123(device_name, nr_seconds \\ 5) do
    IO.puts("Starting test, will run for #{nr_seconds} seconds...")
    # List MIDI ports
    Midiex.ports()

    # Create a virtual output connection
    piano = Midiex.create_virtual_output(device_name)

    # Send to MIDI messages to a connection (Middle C, at full velocity)
    # On channel "1" (bc. "91" and "81")
    note_on = <<0x91, 60, 127>>
    note_off = <<0x81, 60, 127>>

    # Press and release C, twice a second.
    for _n <- 1..(nr_seconds * 2) do
      IO.puts("Middle C....")
      Midiex.send_msg(piano, note_on)
      :timer.sleep(250)
      Midiex.send_msg(piano, note_off)

      IO.puts("Middle C... again ...")
      Midiex.send_msg(piano, note_on)
      :timer.sleep(250)
      Midiex.send_msg(piano, note_off)
    end

    IO.puts("Show's over!")
  end

Not expecting support for Ableton, but maybe this gives a clue? Anything amiss here?

image

Running on Raspi 4 (headless raspberry pi os (debian)) tries to build core midi

I'm so excited to find this library. Hoping to possibly add some contributions to documentation while testing. First thing I noticed was that you need to have the rust tools installed before you can run Mix.install(), once that dependency is handled, and a few other system packages have been installed it seems to work as prescribed. The errors are really nice from rustler.

In addition to running on a mac, I also want to run on a headless pi 4 but am hitting some issues when compiling.

iex -S mix
Erlang/OTP 26 [erts-14.0.2] [source] [64-bit] [smp:4:4] [ds:4:4:10] [async-threads:1] [jit]

==> midiex
Compiling 10 files (.ex)
Compiling crate midiex in release mode (native/midiex)
   Compiling memchr v2.5.0
   Compiling proc-macro2 v1.0.63
   Compiling libc v0.2.138
   Compiling quote v1.0.28
   Compiling regex-syntax v0.6.28
   Compiling unicode-ident v1.0.5
   Compiling pkg-config v0.3.26
   Compiling aho-corasick v0.7.20
   Compiling alsa-sys v0.3.1
Compiling lib/midiex/backend.ex (it's taking more than 10s)
   Compiling bitflags v1.3.2
   Compiling void v1.0.2
   Compiling cfg-if v1.0.0
   Compiling syn v2.0.22
   Compiling unreachable v1.0.0
   Compiling heck v0.4.0
   Compiling rustler v0.29.0
   Compiling lazy_static v1.4.0
   Compiling regex v1.7.0
   Compiling nix v0.24.3
   Compiling alsa v0.7.0
   Compiling rustler_sys v2.3.0
   Compiling midir v0.9.1
   Compiling rustler_codegen v0.29.0
   Compiling midiex v0.1.0 (/home/pi/test/deps/midiex/native/midiex)
error[E0433]: failed to resolve: use of undeclared crate or module `coremidi`
  --> src/lib.rs:11:5
   |
11 | use coremidi::Notification::{ObjectAdded, ObjectRemoved};
   |     ^^^^^^^^ use of undeclared crate or module `coremidi`

error[E0432]: unresolved import `coremidi`
  --> src/lib.rs:10:5
   |
10 | use coremidi::{Client, Notification, AddedRemovedInfo, ObjectType};
   |     ^^^^^^^^ use of undeclared crate or module `coremidi`

Some errors have detailed explanations: E0432, E0433.
For more information about an error, try `rustc --explain E0432`.
error: could not compile `midiex` (lib) due to 2 previous errors

== Compilation error in file lib/midiex/backend.ex ==
** (RuntimeError) Rust NIF compile error (rustc exit code 101)
    (rustler 0.26.0) lib/rustler/compiler.ex:41: Rustler.Compiler.compile_crate/2
    lib/midiex/backend.ex:6: (module)
could not compile dependency :midiex, "mix compile" failed. Errors may have been logged above. You can recompile this dependency with "mix deps.compile midiex", update it with "mix deps.update midiex" or clean it with "mix deps.clean midiex"

I believe that I should be able to not compile coremidi on a non mac platform and compile some other resource, but am unsure how to make the change.

Thanks again! ๐ŸŽน โค๏ธ

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.