Chit chat

======

Built another parallel port led thingy.

SUNP0026

Have a garbled text screen on the command line just use the reset command.

Set the time from he command line: Better to do it from the bios though.

sudo date [MMDDhhmm[[CC]YY][.ss]]

Screenshot - 01162015 - 07:48:34 AM

$ sudo date 011507482015

Have hidden files in your file selector, <ctrl>H will make them disappear or reappear as needed.

—————————————–

The Arduino is one of the neatest microcontrollers.  For something so simple, it can do an amazing amount of projects. One such project that interested me was the Digital melody project. If you have one the the Arduinos where the Atmel chip can be removed, you can make your own project without the board once the programming is done.

For this project, all you will need is the Arduino, usb cable (for programming), computer, some wires, optional 100 ohm resistor, and an old eight ohm speaker. Usually the back of speakers on the magnet have what resistance they are. So grab the old dead radio or the like that has a speaker and see what it has. Old personal computers are likely to have one too that you can borrow for a minute.

Now you need to build the circuit. It is minimal and you should be able to set it up quickly. Resistor adds safety for protecting the Arduino.

 

Set up up your Arduino for programming and load the Arduino IDE program into your computer. Then load in the Digital melody sample from the menu.

The instructions for your Arduino should tell you how to set up your board. Assuming your tools are set up properly, you can now compile and up load the sketch to your Arduino.

 

You should now hear a set of tones that sounds like it came from a cartoon. But what if you wanted to do your own tune. No problem. All you have to do is translate the notes and timing into your Arduino sketch. If you are unfamiliar with musical notation, you might want to get some help on this. The notation for a note might look something like this:

Then you need to have the note durations.

We decided to try doing Silent Night. Of course you need the sheet music to get the notes and the timing. The sketch will provide you with the information of how to translate the notes.

So we began doing our own translation using vim to record our results. Since this is 3/4 timing, things will be tricky.

Oops every thing is in lower case and we need to add the NOTE_ to the beginning of the notes. No problem. a g~~ will convert the letters to uppercase and a :%s!^!NOTE_! will the preface to the notes. So far so good. Now we need to separate the notes from the timings. So save the file.

$ cut -c-7  silentnight > notes-sn

and that gives us:

$ cat notes-sn
NOTE_G3
NOTE_A3
NOTE_G3
NOTE_E3
NOTE_G3
NOTE_A3
NOTE_G3
NOTE_E3
NOTE_D4
NOTE_D4


$ tr ‘\n’ ‘, ‘ < notes-sn > notes-sn.txt
$ sed -i ‘s/,/, /g; s/,\s\+/, /g’ notes-sn.txt
$ cat notes-sn.txt
NOTE_G3, NOTE_A3, NOTE_G3, NOTE_E3, NOTE_G3, NOTE_A3, NOTE_G3, NOTE_E3, NOTE_D4, NOTE_D4, NOTE_B3, NOTE_C4, NOTE_C4, NOTE_G3, NOTE_A3, NOTE_A3, NOTE_C4, … … …

Which can be easily cut and pasted into the sketch.

$ cut -d’-‘ -f2 silentnight  > notes-st

And that gives us

$ cat notes-st
3
8
4
1
3
8
4
1
1
4


Now to add the commas:

$ tr ‘\n’ ‘,’ < notes-st > notes-cs.csv

and that gives us which you can easily cut and paste into the sketch.

$ cat notes-cs.csv

3,8,4,1,3,8,4,1,1,4,1,1,4,1,1,…

To add spaces:
$ sed -i ‘s/,/, /g; s/,\s\+/, /g’ notes-cs.csv

cat notes-cs.csv
3, 8, 4, 1, 3, 8, 4, 1, 1, 4, 1, 1, 4, 1, … … …

You will also need to change this line for the total number of notes.

for (int thisNote = 0; thisNote < 8; thisNote++) {

More music!

—————————————–

In an earlier article, I talked about doing a minimal install of Debian linux (http://computoman.blogspot.com/2014/10/installing-debian.html). Decided to get out an old machine (Gateway Solo 3350 laptop) that this was done with. In playing with the machine, found that there was no sound drivers set up. Did the traditional install of the alsa not the pulse audio stuff.  This an old systeml

$ cat /proc/cpuinfo
processor    : 0
vendor_id    : GenuineIntel
cpu family    : 6
model        : 8
model name    : Pentium III (Coppermine)
stepping    : 3
microcode    : 0x7
cpu MHz        : 597.424
cache size    : 256 KB
fdiv_bug    : no
hlt_bug        : no
f00f_bug    : no
coma_bug    : no
fpu        : yes
fpu_exception    : yes
cpuid level    : 2
wp        : yes
flags        : fpu vme de pse tsc msr pae mce cx8 sep mtrr pge mca cmov pse36 mmx fxsr sse up
bogomips    : 1194.84
clflush size    : 32
cache_alignment    : 32
address sizes    : 36 bits physical, 32 bits virtual
power management:

Did I have a sound card?

$ lspci -v | grep audio
00:09.0 Multimedia audio controller: ESS Technology ES1988 Allegro-1 (rev 12)

Seems I do, so now to install the software.

$ sudo apt-get install alsa-base alsa-utils alsa-tools-gui alsaplayer-alsa  \ alsa-utils

Found the sound still did not work. did the usual modprobe and etc. with no luck. Time to do some research. Apparently I did not have the firmware installed for the sound card. In the article I found on the subject may not have pointed to the lastest firmware to I went to the source and downloaded the software. (alsa-firmware-1.0.28).

The came the process to install the firmware.

$ cd Downloads/
$ tar xvf alsa-firmware-1.0.28.tar.bz2′]
$ cd alsa-firmware-1.0.28/
$ ./configure
$ cd maestro3
$ make
$ su
# mkdir /lib/firmware/ess
# cp *fw /lib/firmware/ess
# modprobe -r snd-maestro3 ; modprobe snd-maestro3
# adduser $USER audio
# exit
$ exit

Now to test the setup.  Now to see what the settings are on the card. You will want to unmute any output devices and raise the volumes as needed.

$ alsamixer

$ aplay /usr/share/sounds/alsa/Noise.wav
$ speaker-test -t sine -f 440 -c 2
$ speaker-test -t wav -c 2

Now it seems I have sound for everything that happens. Yea!

—————————————–

Sometimes it is just nice to make a picture into an html file. Many pictures are in the .png format.  To use them to be converted to an html file they must first be converted to the .jpg format. For experimentation purposes start with a simple picture with a lot of contrast.

$ convert  speaker.png  speaker.jpg

speaker

By imbedding the picture in a page, it prevents you from having to keep lots of separate image files. Now let us convert it to an html page.
$ jconvert ws.png ws.jpg
jp2a –color –html –fill –background=light ws.jpg –output=hs.html

Screenshot - 01162015 - 07:05:01 AM

You can then go in and edit the html for further enchancement.

Screenshot from 2015-01-16 07:06:22

Let’s add a title and some ruler lines.

Screenshot from 2015-01-16 07:14:44

The rest is up to your imagination.

—————————————–

Bought the rc rechargeable batteries dirt cheap with the hope of using them with the microcontrollers such as the Raspberry Pi and the arduino, but they charged up to a bit higher value than I expected as the are rated for 4.5 volts.

SUNP0021SUNP0023

Thinking about using something like this to use as a voltage regulator. Probably will not work.

voltage45regulator

—————————————–

Got some old propeller chips as a gift.   Need to start building projects with it such as a C=64 clone.

SUNP0029

A circuit like this is what they say to start with.

PropConnections

The Simpleide software should be able to handle the programming for the cpu.

Screenshot from 2015-01-16 13:12:37

—————————————–

You never know when a simple cartoon can make a difference. Be sure and save all your doodles.

hardwareinstructs

macceronimaker

Tuxpaint is one of my favorite programs to draw with.

Screenshot from 2015-01-16 11:37:27Screenshot from 2015-01-16 11:38:15

—————————————–

Could of sworn, I already publish this article, but could not find it in a web search. Oh well here is a reprint:

Mom use to have an autoharp. She would play it once in a while. Kind of missed that old thing. Did not want to go out and purchase one. Saw a minimal bash script to let a linux box with sound emulate an autoharp. I modified that script to do a bit more.  It only has a few chords, but it is the most I will need for a while. Working on a super version,

Just like a regular autoharp, all you have to do is press a key for the chord sounding.

Use it. (super simple example):

On Top of Old Smokie

Old
(C)On top of old (F)Smokie, all covered in (C)snow,
I lost my true (G7 3)lover, by courtin' too (C)slow
(C)on top of old (F)Smokie, I went there to (C)weep
For a false hearted (G7)lover, is worse than a (C)thief

(C)A thief he will (F)rob you, and take what you (C)save
But a false hearted (G7)lover, will put you in your (C)grave
(C)On top of old (F)Smokie, all covered in (C)snow
I lost my true (G7)lover, by courtin' too (C)slow

(C) They'll hug you and (F)kiss you, then tell you more (C)lies
Than the crossties on the (G7) railroad, or the stars in the (C)skies
(C)on top of old (F)Smokie, all covered in (C) snow
I lost my true (G7)lover, by courtin' too (C)slow

New

(1) On top of old (4)Smokie, all covered in (1)snow,
I lost my true (3)lover, by courtin' too (1)slow
(1)on top of old (4)Smokie, I went there to (1)weep
For a false hearted (3)lover, is worse than a (1)thief

(1)A thief he will (4)rob you, and take what you (1)save
But a false hearted (3)lover, will put you in your (1)grave
(1)On top of old (4)Smokie, all covered in (1)snow
I lost my true (3)lover, by courtin' too (1)slow

(1) They'll hug you and (4)kiss you, then tell you more (1)lies
Than the crossties on the (3) railroad, or the stars in the (1)skies
(1)on top of old (4)Smokie, all covered in (1)snow
I lost my true (3)lover, by courtin' too (1)slow

Here is the source code that you can cut and paste into your favorite linux editor.


#!/bin/bash
#
# Script to emulate an autoharp.
#
while :
do
clear
echo "************************"
echo "* Mom's autoharp       *"
echo "************************"
echo "* [1] C major          *"
echo "* [2] A minor          *"
echo "* [3] G 7th            *"
echo "* [4] F major          *"
echo "* [5] D minor          *"
echo "* [6] E minor          *"
echo "* [7] E 7th            *"
echo "* [8] A 7th            *"
echo "* [9] C 7th            *"
echo "* [+] D 7th            *"
echo "* [-] G major          *"
echo "*                      *"
echo "* [0] Exit/Stop        *"
echo "************************"
echo
echo "Enter your menu choice [1-9, +, - or 0]: "
read -n 1 yourch
case $yourch in
1) play -n synth pl C2 pl E2 pl G2 pl C3 pl E3 pl G3 delay 0 .05 .1 .15 .2 .25 remix - fade 0 1.5 .1 norm -1  ;;
2) play -n synth pl A2 pl C2 pl E2 pl A3 pl C3 pl E3 delay 0 .05 .1 .15 .2 .25 remix - fade 0 1.5 .1 norm -1  ;;
3) play -n synth pl G2 pl B2 pl D2 pl F4 pl G3 pl B3 pl D3 pl F4 delay 0 .05 .1 .15 .2 .25 remix - fade 0 1.5 .1 norm -1  ;;
4) play -n synth pl F2 pl A2 pl C2 pl F3 pl A3 pl C3 delay 0 .05 .1 .15 .2 .25 remix - fade 0 1.5 .1 norm -1  ;;
5) play -n synth pl D2 pl F2 pl A2 pl D3 pl A3 pl F4 delay 0 .05 .1 .15 .2 .25 remix - fade 0 1.5 .1 norm -1  ;;
6) play -n synth pl E2 pl G2 pl B2 pl E3 pl B3 pl G4 delay 0 .05 .1 .15 .2 .25 remix - fade 0 1.5 .1 norm -1  ;;
7) play -n synth pl E2 pl G#2 pl B2 pl D2 pl E3 pl B3 pl G#4 delay 0 .05 .1 .15 .2 .25 remix - fade 0 1.5 .1 norm -1  ;;
8) play -n synth pl A2 pl C#2 pl E2 pl G2 pl A3 pl C#3 pl E3 pl G3 delay 0 .05 .1 .15 .2 .25 remix - fade 0 1.5 .1 norm -1  ;;
9) play -n synth pl C2 pl E2 pl G2 pl A#2  pl C3 pl E3 pl G3 pl A#3 delay 0 .05 .1 .15 .2 .25 remix - fade 0 1.5 .1 norm -1  ;;
+)  play -n synth pl D2 pl F#2 pl A2 pl C3  pl D3 pl F#3 pl A3 pl C4 delay 0 .05 .1 .15 .2 .25 remix - fade 0 1.5 .1 norm -1  ;;
-) play -n synth pl G2 pl B2 pl D2 pl G3 pl B3 pl D3 delay 0 .05 .1 .15 .2 .25 remix - fade 0 1.5 .1 norm -1  ;;
0) exit 0;;
*) echo "Oopps!!! Please select choice 1,2,3,4,5,6,7,8,9,-, or +"
echo "Press Enter to continue. . ." ; read ;;
esac
done

Note: make sure sox is installed.
$ sudo apt-get install sox
—————————————–

Made this variation on a tv antenna. A cd case with clips on the side.  Have not really tried it yet. It basically the same old antenna like the traditional coat hanger antennas, but just using different parts.

Screenshot - 01112015 - 10:24:13 PM

And the unit itself: (one connecting wire for each side.

F64PM41I4SCK1A9.MEDIUM

—————————————–

Simple fried eggs and turkey bacon.

SUNP0025

Good day.

Advertisements