Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8029325
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T00:24:08+00:00 2026-06-05T00:24:08+00:00

I have been playing with creating sounds using mathematical wave functions in C. The

  • 0

I have been playing with creating sounds using mathematical wave functions in C. The next step in my project is getting user input from a MIDI keyboard controller in order to modulate the waves to different pitches.

My first notion was that this would be relatively simple and that Linux, being Linux, would allow me to read the raw data stream from my device like I would any other file.

However, research overwhelmingly advises that I write a device driver for the MIDI controller. The general idea is that even though the device file may be present, the kernel will not know what system calls to execute when my application calls functions like read() and write().

Despite these warnings, I did an experiment. I plugged in the MIDI controller and cat’ed the “/dev/midi1” device file. A steady stream of null characters appeared, and when I pressed a key on the MIDI controller several bytes appeared corresponding to the expected Message Chunks that a MIDI device should output. MIDI Protocol Info

So my questions are:

Why does the cat’ed stream behave this way?

Does this mean that there is a plug and play device driver already installed on my system?

Should I still go ahead and write a device driver, or can I get away with reading it like a file?

Thank you in advanced for sharing your wisdom in these areas.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T00:24:09+00:00Added an answer on June 5, 2026 at 12:24 am

    Why does the cat’ed stream behave this way?

    Because that is presumably the raw MIDI data that is being received by the controller. The null bytes are probably some sort of sync tick.

    Does this mean that there is a plug and play device driver already installed on my system?

    Yes.

    However, research overwhelmingly advises that I write a device driver for the MIDI controller. The general idea is that even though the device file may be present, the kernel will not know what system calls to execute when my application calls functions like read() and write().

    <…>

    Should I still go ahead and write a device driver, or can I get away with reading it like a file?

    I’m not sure what you’re reading or how you’re coming to this conclusion, but it’s wrong. 🙂 You’ve already got a perfectly good driver installed for your MIDI controller — go ahead and use it!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've been playing around with creating a new user and I keep getting this
I have been playing with creating a fully typed DSEL in Haskell using GADTs
I have been playing around with the MVP pattern using winforms for the last
I have been playing around with using graphs to analyze big data. Its been
I have been playing around with creation of pdf documents for a project that
I've been playing around with creating an application using the S#arp Architecture . One
I am playing around with creating a Windows Phone application. I have been watching
I have been playing around a bit with a fairly simple, home-made search engine,
I have been playing around with the Rhino ETL library and really like the
I have been playing around with NSURLConnection. Now I'm trying to grab some data

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.