Thread: New to C Programing; wanting to write a very simple and specific program

  1. #1
    Registered User
    Join Date
    Feb 2021
    Posts
    1

    New to C Programing; wanting to write a very simple and specific program

    I wanted to write a "Note Duration Determiner"; something that I can launch and it will recognize and record keystrokes as notes.

    If I hit and hold in the space bar for 4 seconds, it will recognize and record it as a whole (W) note; 2 seconds would be a half (H) note, etc... it would stop "recording" the duration of the note when the space bar is released and record up to 4 bars.

    Is this something that can be done in C? It (obviously) doesn't have to determine any pitch, just the duration and maybe be able to change the time signature as I've seen people write metronomes in C.

    I just downloaded Visual Studio Community, so I haven't touched C Programing at all, but wanted to make sure that this is something it would be able to do before I get too far into it and realize it isn't going to fulfill my needs.

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,659
    Since you mentioned visual studio, I'll assume your OS is windows.

    If you're writing a GUI program, start here
    Keyboard Input (Get Started with Win32 and C++) - Win32 apps | Microsoft Docs
    Using Keyboard Input - Win32 apps | Microsoft Docs

    If you're writing a console program, perhaps this
    ReadConsoleInput function - Windows Console | Microsoft Docs
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. how to write a program of a simple calculator?
    By yeohwl91 in forum C Programming
    Replies: 5
    Last Post: 09-24-2011, 04:04 PM
  2. Could someone please write a simple program for me?!
    By danjer242 in forum C++ Programming
    Replies: 1
    Last Post: 03-28-2010, 10:43 PM
  3. Can any one write a simple C Program 4 this??
    By sriki in forum C Programming
    Replies: 30
    Last Post: 12-03-2007, 03:48 PM
  4. I want to write a simple program in C++ to...
    By Danhash in forum Windows Programming
    Replies: 3
    Last Post: 03-07-2003, 01:38 PM
  5. how to write simple C program?
    By edwardkys in forum C Programming
    Replies: 3
    Last Post: 11-22-2002, 05:50 PM

Tags for this Thread