Coder Social home page Coder Social logo

A better way to specify notes? about beep HOT 4 OPEN

spkr-beep avatar spkr-beep commented on August 22, 2024
A better way to specify notes?

from beep.

Comments (4)

dawidi avatar dawidi commented on August 22, 2024 1

Here's what I did with shell script wrappers around beep:
sound
This is just a slightly more elegant way to specify frequency,duration pairs - named after the SOUND command in BASIC.
spkplay
This interprets a music-oriented notation similar to the PLAY command in BASIC, setting the tempo, note lengths, octaves, staccato/legato playing styles, sharp/flat notes etc.
Like so:
spkplay t114 mn l16 o4 c d f d l8 a. a. l4 g ms l16 c d f d l8 g. g. f mn l16 e l8 d l16 c d f d l4 f l8 g e. l16 d l4 c l8 c l4 g l2 f

from beep.

ndim avatar ndim commented on August 22, 2024

Thank you for that information.

Also, a quick remark on the command line argument checks:

if [[ "$@" == "" ]]; then

The "$@" expands to multiple arguments if the script is called with multiple arguments like script.bash foo bar bla, which results in the test expression being evaluated to be [[ "foo" "bar" "bla" == "" ]] which does not appear to be what you intended here.

Are you sure you did not want to check "$*" == "" here instead, or maybe even "$#" -lt 1?

from beep.

dawidi avatar dawidi commented on August 22, 2024

Indeed, "$#" -lt 1 would be better, that's what I meant to do. The "wrong" way still coincidentally does the right thing, but not for the right reason. Thanks!

from beep.

ndim avatar ndim commented on August 22, 2024

The BSDs appears to have a kernel implementation reminding me of the IBM BASIC way of specifying notes, which the speaker(4) man page describes pretty well:

https://www.freebsd.org/cgi/man.cgi?query=speaker&sektion=4&manpath=FreeBSD+13.0-RELEASE+and+Ports
https://man.netbsd.org/speaker.4

from beep.

Related Issues (20)

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.