Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Fri 17 Nov 2017, 15:56
All times are UTC - 4
 Forum index » Off-Topic Area » Programming
Supercharged beep
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 1 [4 Posts]  
Author Message
vovchik


Joined: 23 Oct 2006
Posts: 1441
Location: Ukraine

PostPosted: Tue 26 Sep 2017, 10:40    Post subject:  Supercharged beep
Subject description: Beep surrogate - should play using built-in sound system
 

Dear all,

I couldn't resist doing this, all the more that the PC speaker does not really work in many modern *nixes. It is beep program embellished by a soundfont. And it can actually play music, after a fashion. Smile

Here is a copy of the first part of the help:

Code:
sfbleep is a supercharged beep command that makes use
of an embedded soundfont. You can control the voice,
the pitch, the duration and the amplitude of the sound.

Usage: sfbleep a b c d

 where a = voice [0 to 212], b = note [0 to 125],
 c = duration in milliseconds and d = volume [0-100].

Enter sfbleep -l to see all available voices.


I have included a script demo that actually plays a melody. The binary is 32-bit Tahr - stripped and upx'd. Have fun. Smile

With kind regards,
vovchik

UPDATED: Forgot to include scripts at first.

PS. The sources are just a tad over the 256k attachment limit, so you can get them here: http://basic-converter.proboards.com/attachment/download/2310.
sfbleep-32bit-tahr.tar.gz
Description 
gz

 Download 
Filename  sfbleep-32bit-tahr.tar.gz 
Filesize  119.1 KB 
Downloaded  13 Time(s) 

Last edited by vovchik on Wed 27 Sep 2017, 05:12; edited 1 time in total
Back to top
View user's profile Send private message 
vovchik


Joined: 23 Oct 2006
Posts: 1441
Location: Ukraine

PostPosted: Tue 26 Sep 2017, 12:03    Post subject:  

Dear all,

I got my little bleepy thing doing counterpoint and harmony in bash, of all things. Smile


Code:
#!/bin/bash

# Demo of sfbleep playing melodies - vovchik, 2017
# Les Parapluies de Cherbourg - over and over again
# and somewhat humanized (e.g. duration and amplitude),
# and harmonized.

# variable x is used for looping through all the voices (213)
# variable y is transposition factor
# melody consists of 32 notes
# variable z is harmony voice

declare -i y=12
declare -i z=211
echo "--------------------------------------"
echo "Playing Les Parapluies de Cherbourg"
echo "using sfbleep's 213 soundfont presets."
# loop through all the voices
for x in {0..212}; do
   echo "--------------------------------------"
   echo "Soundfont voice $x is now playing..."
   echo "--------------------------------------"
   # transpose by 12 chromatic steps using y
   echo "********* Phrase 1 *********"
   ./sfbleep $x $((y+48)) 300 40
   ./sfbleep $x $((y+50)) 300 45
   ./sfbleep $x $((y+51)) 350 50
   ./sfbleep $z $((y+41)) 1400 40&
   ./sfbleep $z $((y+44)) 1300 25&
   ./sfbleep $z $((y+48)) 1300 35&
   ./sfbleep $z $((y+51)) 1400 30&
   ./sfbleep $x $((y+56)) 1200 60
   echo "********* Phrase 2 *********"
   ./sfbleep $x $((y+46)) 300 40
   ./sfbleep $x $((y+48)) 300 45
   ./sfbleep $x $((y+50)) 250 50
   ./sfbleep $z $((y+39)) 1400 40&
   ./sfbleep $z $((y+43)) 1300 40&
   ./sfbleep $z $((y+46)) 1400 40&
   ./sfbleep $z $((y+50)) 1300 40&
   ./sfbleep $x $((y+55)) 1320 60
   echo "********* Phrase 3 *********"
   ./sfbleep $x $((y+44)) 300 30
   ./sfbleep $x $((y+46)) 300 45
   ./sfbleep $x $((y+48)) 350 50
   ./sfbleep $z $((y+38)) 1300 40&
   ./sfbleep $z $((y+41)) 1400 40&
   ./sfbleep $z $((y+44)) 1300 40&
   ./sfbleep $z $((y+48)) 1400 40&
   ./sfbleep $x $((y+53)) 1290 60
   echo "********* Phrase 4 *********"
   ./sfbleep $x $((y+43)) 300 25
   ./sfbleep $x $((y+45)) 300 35
   ./sfbleep $x $((y+47)) 250 40
   ./sfbleep $z $((y+36)) 1400 40&
   ./sfbleep $z $((y+39)) 1300 25&
   ./sfbleep $z $((y+43)) 1300 30&
   ./sfbleep $z $((y+46)) 1400 30&
   ./sfbleep $x $((y+51)) 1500 50
   echo "********* Phrase 5 *********"
   ./sfbleep $x $((y+48)) 300 40
   ./sfbleep $x $((y+50)) 300 45
   ./sfbleep $x $((y+51)) 350 50
   ./sfbleep $z $((y+29)) 1400 40&
   ./sfbleep $z $((y+41)) 1400 40&
   ./sfbleep $z $((y+44)) 1300 25&
   ./sfbleep $z $((y+48)) 1300 35&
   ./sfbleep $z $((y+51)) 1400 30&
   ./sfbleep $x $((y+56)) 1200 60
   echo "********* Phrase 6 *********"
   ./sfbleep $x $((y+46)) 300 40
   ./sfbleep $x $((y+48)) 300 45
   ./sfbleep $x $((y+50)) 250 50
   ./sfbleep $z $((y+27)) 1400 40&
   ./sfbleep $z $((y+39)) 1400 40&
   ./sfbleep $z $((y+43)) 1300 40&
   ./sfbleep $z $((y+46)) 1400 40&
   ./sfbleep $z $((y+50)) 1300 40&
   ./sfbleep $x $((y+55)) 400 50
   ./sfbleep $x $((y+55)) 1080 60
   echo "********* Phrase 7 *********"
   ./sfbleep $x $((y+44)) 300 30
   ./sfbleep $x $((y+46)) 300 45
   ./sfbleep $x $((y+48)) 350 50
   ./sfbleep $z $((y+26)) 1200 40&
   ./sfbleep $z $((y+38)) 1200 40&
   ./sfbleep $z $((y+41)) 1300 40&
   ./sfbleep $z $((y+44)) 1200 40&
   ./sfbleep $z $((y+48)) 1300 40&
   ./sfbleep $x $((y+53)) 1390 60
   echo "********* Phrase 8 *********"
   ./sfbleep $x $((y+50)) 250 25
   ./sfbleep $z $((y+19)) 500 50&
   ./sfbleep $z $((y+31)) 500 50&
   ./sfbleep $z $((y+43)) 500 50&
   ./sfbleep $z $((y+47)) 500 30&
   ./sfbleep $z $((y+50)) 500 30&
   ./sfbleep $z $((y+53)) 500 30&
   ./sfbleep $x $((y+53)) 300 35
   ./sfbleep $x $((y+51)) 250 40
   ./sfbleep $z $((y+24)) 1400 40&
   ./sfbleep $z $((y+36)) 1400 40&
   ./sfbleep $z $((y+39)) 1300 25&
   ./sfbleep $z $((y+43)) 1300 30&
   ./sfbleep $z $((y+46)) 1400 30&
   ./sfbleep $x $((y+48)) 1500 50
done
echo "--------------------------------------"
echo "This sfbleep demo thankfully ended."
echo "--------------------------------------"


Have fun!. Smile

With kind regards,
vovchik

Last edited by vovchik on Wed 27 Sep 2017, 11:38; edited 6 times in total
Back to top
View user's profile Send private message 
amigo

Joined: 02 Apr 2007
Posts: 2611

PostPosted: Tue 26 Sep 2017, 13:37    Post subject:  

Is there a link to sources which doesn't require membership at proboards?
Back to top
View user's profile Send private message 
vovchik


Joined: 23 Oct 2006
Posts: 1441
Location: Ukraine

PostPosted: Tue 26 Sep 2017, 13:55    Post subject:  

Dear amigo,

No, not that I know of. But here are the sources - I split them into two parts to overcome the 256k board limit per attachment. Just copy the one file in part2 into part1 - and use the latest bacon, which is available from fossil. I get the latest beta using a script:

Code:
rm -R bacon_trunk/
rm .fslckout
rm bacon.fossil
fossil clone http://nobody:ignore@fossilrepos.sourceforge.net/srv.fsl/144/bacon bacon.fossil
fossil open bacon.fossil
cd bacon_trunk/
./configure --prefix=/usr
make
sudo make install


With kind regards,
vovchik

PS. I think you will need to have libasound2-dev installed in order to compile. It contains the alsa header.
bleep-src-part2.tar.gz
Description 
gz

 Download 
Filename  bleep-src-part2.tar.gz 
Filesize  140.67 KB 
Downloaded  9 Time(s) 
bleep-src-part1.tar.gz
Description 
gz

 Download 
Filename  bleep-src-part1.tar.gz 
Filesize  117.63 KB 
Downloaded  11 Time(s) 
Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 1 of 1 [4 Posts]  
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » Off-Topic Area » Programming
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0556s ][ Queries: 12 (0.0044s) ][ GZIP on ]