Coder Social home page Coder Social logo

Comments (6)

ndim avatar ndim commented on August 22, 2024

You can already do almost the same thing using xargs from GNU findutils:

[user@host ~]$ cat beep-file 
-f 1006.25 -l 160.0 -d 0 -D 0
-f 1025.0 -l 160.0 -d 0 -D 0
-f 1000.0 -l 160.0 -d 0 -D 0
-f 1037.5 -l 160.0 -d 0 -D 0
-f 1031.25 -l 160.0 -d 0 -D 0 -n -f 1031.25 -l 160.0 -d 0 -D 0
-f 1012.5 -l 160.0 -d 0 -D 0
-f 1018.75 -l 160.0 -d 0 -D 0
-f 1012.5 -l 160.0 -d 0 -D 0
[ 18:37:57 | 1036 | 0 | ~ ]
[user@host ~]$ xargs -l beep < beep-file
[user@host ~]$ xargs -t -l beep < beep-file
beep -f 1006.25 -l 160.0 -d 0 -D 0 
beep -f 1025.0 -l 160.0 -d 0 -D 0 
beep -f 1000.0 -l 160.0 -d 0 -D 0 
beep -f 1037.5 -l 160.0 -d 0 -D 0 
beep -f 1031.25 -l 160.0 -d 0 -D 0 -n -f 1031.25 -l 160.0 -d 0 -D 0 
beep -f 1012.5 -l 160.0 -d 0 -D 0 
beep -f 1018.75 -l 160.0 -d 0 -D 0 
beep -f 1012.5 -l 160.0 -d 0 -D 0 
[user@host ~]$ 

Admittedly, not every implementation of xargs implements -L or -l (e.g. busybox xargs), and you cannot just use #!/usr/bin/xargs -l beep as the first line of an executable script due to the part after the first space in that line being used as a single string parameter to the part before the first space.

Does integrating parts of the xargs functionality into beep really make sense?

from beep.

xssfox avatar xssfox commented on August 22, 2024

from beep.

ndim avatar ndim commented on August 22, 2024

That is a very valid point. Do you expect your file length to ever potentially exceed 2KB or 4KB?

from beep.

xssfox avatar xssfox commented on August 22, 2024

hmm. It currently sits just below 4KB

from beep.

ndim avatar ndim commented on August 22, 2024

OK, that rules out something along the lines of

beep $(python -c "print(' -n '.join([s.strip() for s in open('beep-file').readlines()]))")

for system with older shells, as those had limits on the maximum length of the command line around the 4K mark.

Are you writing those files by hand, or are those files generated from something else? We could either try to find a less verbose way of writing notes, or go one level further and process something closer to your source.

Or I could alter beep after all in a way such that it can read notes not just from the command line but also from files, maybe with a new way of writing the notes (see #19).

from beep.

xssfox avatar xssfox commented on August 22, 2024

These are generated using a python script at the moment but the intent is to be able to have a script that anyone can run provided they have beep installed.

When I was testing with a windows beep app it used freq duration \s sleep freq duration \s sleep freq duration \s sleep ... where \s sleep is an optional delay between notes

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.