choice.locks
Posts: 34
Joined: Fri Dec 25, 2015 8:51 pm

Screaming jellybaby programming

Wed Dec 30, 2015 6:47 pm

Tried to setup the screaming jellybaby physical computing project. Followed the onscreen instructions to the letter. Error messages physical directory doesnt exist. Took a look in sonic pi as well and couldnt find a sample file burp. We managed to play some of the sample files in sonic pi. We managed to play one of the other sound files but when we tried to save they went on to the desktop. Could someone think these instructions through for us we are new to this. If it didnt say enter in the instructions for example we didnt push enter. We literally followed the instructions word for word why would it have failed to work.

Navyscourge
Posts: 258
Joined: Sat Oct 24, 2015 1:50 pm

Re: Screaming jellybaby programming

Wed Dec 30, 2015 7:27 pm

You don't give us a lot of information to help you :D - you are only likely to get help from someone who knows which instructions you are following. You also don't say which bit does not work; which step gives the error message?

I googled, but could only find a SINGING jelly baby project - is that the one? (http://www.ocr.org.uk/Images/125881-rec ... y-baby.pdf)

User avatar
B.Goode
Posts: 8987
Joined: Mon Sep 01, 2014 4:03 pm
Location: UK

Re: Screaming jellybaby programming

Wed Dec 30, 2015 7:43 pm

Perhaps choice.locks is referring to https://www.raspberrypi.org/learning/bu ... worksheet/ ?

There is no sample file burp in the sonic-pi samples: the Worksheet I am looking at says correctly that it is called misc_burp.wav - that file does exist in my installation of Sonic-Pi.

@choice.locks: could you specify what stage of the instructions gives the error "physical directory doesnt exist"

choice.locks
Posts: 34
Joined: Fri Dec 25, 2015 8:51 pm

Re: Screaming jellybaby programming

Wed Dec 30, 2015 8:14 pm

This is the instructions as per learn right next to the forum button its in an introduction to physical computing
If you type into google screaming baby raspberry pi you will find it too.
We followed as per instructions down to playing the audio file. And it did not play this is where the termainal sail no such directory.

choice.locks
Posts: 34
Joined: Fri Dec 25, 2015 8:51 pm

Re: Screaming jellybaby programming

Wed Dec 30, 2015 8:45 pm

Raspberry pi.org burping jelly baby

jbudd
Posts: 1025
Joined: Mon Dec 16, 2013 10:23 am

Re: Screaming jellybaby programming

Wed Dec 30, 2015 9:04 pm

Firstly, accuracy is important with Linux: e.g. "cc" is very different to "cp" and "screaming jellybaby" is very different to "burping jelly baby" ;)

I looked at the Burping Jelly Baby project. There are two places where you attempt to play burp.wav:
1 Create a new folder called jellybaby with the following command:
mkdir jellybaby
2 Enter the folder with cd jellybaby
We're going to need a burping sample sound file for this project so we'll use one from Sonic Pi.
3 Make a copy of Sonic Pi's sound of a burp with the following command:
cp /opt/sonic-pi/etc/samples/misc_burp.wav burp.wav
This will copy the misc_burp sound file from the sonic-pi folder into the jellybaby folder and rename it to burp.wav
4 Now test that you can play the sound file using omxplayer by typing:
omxplayer burp.wav
and
7 Create a loop that runs forever and plays the burping sound file when the two wires inside the jelly baby are touching by typing the following:
while True:
if GPIO.input(3) == False:
os.system("omxplayer burp.wav")
time.sleep(1)

8 Save the file by clicking on File and Save.

9 Finally, run the program by clicking on Run and Run Module
Which one gives you the error?
Please can you give us the exact error message that you get?

I suggest that you check the location of the burp.wav file. In a terminal window type

Code: Select all

cd
find . -name burp.wav
If it shows the file in /home/pi/jellybaby, try changing the Python script so it says

Code: Select all

    os.system("omxplayer /home/pi/jellybaby/burp.wav")

choice.locks
Posts: 34
Joined: Fri Dec 25, 2015 8:51 pm

Re: Screaming jellybaby programming

Wed Dec 30, 2015 9:52 pm

Here was our first error code which came up after this programming entered
cp /opt/somic-pi/etc/samples/misc_burp.wav burp.wav omxplayer burp.wav
Please note no enter pressed in all of above it doesnt say it in the instructions
We next pressed enter and received this error message
Cp: target "burp.wa" is not a directory

jbudd
Posts: 1025
Joined: Mon Dec 16, 2013 10:23 am

Re: Screaming jellybaby programming

Wed Dec 30, 2015 9:54 pm

That is two commands. You need to do
cp /opt/somic-pi/etc/samples/misc_burp.wav burp.wav <return>
omxplayer burp.wav <return>

choice.locks
Posts: 34
Joined: Fri Dec 25, 2015 8:51 pm

Re: Screaming jellybaby programming

Wed Dec 30, 2015 10:12 pm

Great i suspected that might be the case but if the manufacturer gives instructions that dont say return. I wasnt going to press return. I will try it now any more problems i will re post if not i will say post closed please bear with me.

choice.locks
Posts: 34
Joined: Fri Dec 25, 2015 8:51 pm

Re: Screaming jellybaby programming

Wed Dec 30, 2015 10:19 pm

Entered
cp /opt/sonic.pi/etc/ samples/misc_burp.wav burp.wav
Return key
Error message
omxplayer burp.wav
Cp: target "burp.wav" is not a directory

Navyscourge
Posts: 258
Joined: Sat Oct 24, 2015 1:50 pm

Re: Screaming jellybaby programming

Wed Dec 30, 2015 10:26 pm

As said above, accuracy is so important with computers; screaming, burping, singing are all different words to a computer. Google sometimes copes with that as it matches 3 out of 4 words and shows a link

The instructions do not say press Enter, but every grey-background box shows a single line that you type on the Pi and press enter afterwards. Also this forum does not do command entry very well unless you use the 'code' tags - click the box marked Code shown above the forum text box. Your post came out as one line (which may have been what you typed on the Pi, as you did not press enter)

"cp /opt/somic-pi/etc/samples/misc_burp.wav burp.wav omxplayer burp.wav"

As jbudd posted, it should be two lines, better expressed as

Code: Select all

cp /opt/somic-pi/etc/samples/misc_burp.wav burp.wav
omxplayer burp.wav
Note your typing error - "somic-pi" instead of "sonic-pi". Again, it is important to be careful to get the words and spelling correct. The "cp" command is a copy files command; because you may have combined the two lines, cp 'thinks' that you want to copy 3 files to the last 'word', that is (in English):

"copy files /opt/somic-pi/etc/samples/misc_burp.wav, burp.wav and omxplayer to burp.wav (a directory, as you gave multiple files)"

Given what is said in the rest of the posts, I think typing the two lines separately should work. Let me know if they do ;)

jbudd
Posts: 1025
Joined: Mon Dec 16, 2013 10:23 am

Re: Screaming jellybaby programming

Wed Dec 30, 2015 10:35 pm

*Blush* I should have spotted that typo!

As someone said, accuracy is important!

jbudd
Posts: 1025
Joined: Mon Dec 16, 2013 10:23 am

Re: Screaming jellybaby programming

Wed Dec 30, 2015 10:38 pm

I had fun watching the screaming jelly baby experiment on youtube and wondering how it related to the Raspberry Pi !

choice.locks
Posts: 34
Joined: Fri Dec 25, 2015 8:51 pm

Re: Screaming jellybaby programming

Wed Dec 30, 2015 10:42 pm

New error message typed in
os.system("omxplayer /home/pi/jellybaby/burp.wav")
Error message
Bash: syntax error near unexpected token '"omxplayer /home/pi/jellybaby/burp.wav"'

choice.locks
Posts: 34
Joined: Fri Dec 25, 2015 8:51 pm

Re: Screaming jellybaby programming

Wed Dec 30, 2015 10:46 pm

Thought there might be some typos in my post as did it in a rush but lets assume there were no typos in the original programming why didnt it work in that case and what does that error message mean then?

jbudd
Posts: 1025
Joined: Mon Dec 16, 2013 10:23 am

Re: Screaming jellybaby programming

Wed Dec 30, 2015 11:18 pm

choice.locks wrote:New error message typed in
os.system("omxplayer /home/pi/jellybaby/burp.wav")
Error message
Bash: syntax error near unexpected token '"omxplayer /home/pi/jellybaby/burp.wav"'
You are mixing up the Bash shell command line and Python. os.system("omxplayer /home/pi/jellybaby/burp.wav") is a line of Python. You can use it in a Python program but it makes no sense if you type it in to the command line.

Code: Select all

cp /opt/sonic-pi/etc/samples/misc_burp.wav burp.wav
omxplayer burp.wav
Did you try pressing Enter after both commands?

The first line is a Bash command to copy the file /opt/sonic-pi/etc/samples/misc_burp into the current directory and name it burp.wav
The second line is a Bash command to run the omxplayer command to play the file burp.wav

Navyscourge
Posts: 258
Joined: Sat Oct 24, 2015 1:50 pm

Re: Screaming jellybaby programming

Wed Dec 30, 2015 11:20 pm

Looking at the instructions, you are supposed to open the Python programming environment with

Code: Select all

sudo idle3 &
You then type the code in that program, using steps 3 to 7

If I enter

Code: Select all

os.system("omxplayer /home/pi/jellybaby/burp.wav")
at the Pi prompt, I get the error message that you got. It means that 'bash' (the program that is processing what you type) cannot understand what the "os.system..." line means. It is a Python command, and belongs in the Python editor

User avatar
DougieLawson
Posts: 36515
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website Twitter

Re: Screaming jellybaby programming

Wed Dec 30, 2015 11:23 pm

choice.locks wrote:New error message typed in
os.system("omxplayer /home/pi/jellybaby/burp.wav")
Error message
Bash: syntax error near unexpected token '"omxplayer /home/pi/jellybaby/burp.wav"'
You've asked /bin/bash to try to run a /usr/bin/python command. The syntax error is simply bash saying "I don't know what you've asked me to do."

If you want to run omxplayer from bash simply type omxplayer /home/pi/jellybaby/burp.wav
Note: Having anything humorous in your signature is completely banned on this forum. Wear a tin-foil hat and you'll get a ban.

Any DMs sent on Twitter will be answered next month.

This is a doctor free zone.

choice.locks
Posts: 34
Joined: Fri Dec 25, 2015 8:51 pm

Re: Screaming jellybaby programming

Thu Dec 31, 2015 2:57 am

Sorry but it has got a bit too complicated. Would you mind breaking that down as if you were talking to say a child of 10 as we are brand new to raspberry pi. I dont know what bash is take it from the beginning please and imagine that you were writing instructions for a child I am sure that if its put on the forum in a step by step format re now open terminal by clicking on and now open python by going to etc it would really help a lot of children to understand physical computing.

User avatar
rpdom
Posts: 15567
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: Screaming jellybaby programming

Thu Dec 31, 2015 4:01 am

bash is a type of program (called a "shell") that interprets command and executes them, When you type things at the $ prompt you are (usually) using bash. bash can be used as a simple programming language.

Python is another program that interprets commands, but different ones. Usually the Python commands are put in a file and executed from there. Python is a more powerful programming language.

In any programming it is very important to follow instructions exactly. That includes spelling, Capital Letters, punctuation and spacing.

When showing us an error message please copy and paste the exact message from the screen if you can, otherwise type it very carefully. Typos are not helpful.

You typed

Code: Select all

cp /opt/sonic.pi/etc/ samples/misc_burp.wav burp.wav
Why is there a space between "/opt/sonic.pi/etc/" and "samples/misc_burp.wav"? The instructions don't show a space there.

Code: Select all

cp /opt/sonic-pi/etc/samples/misc_burp.wav burp.wav

choice.locks
Posts: 34
Joined: Fri Dec 25, 2015 8:51 pm

Re: Screaming jellybaby programming

Thu Dec 31, 2015 5:00 am

Please go to this page
Raspberry pi.org>learning
And you should find "make a burping jelly baby"
I am sure that there is a space at this point in the instructions for programming

User avatar
rpdom
Posts: 15567
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: Screaming jellybaby programming

Thu Dec 31, 2015 5:15 am

You mean this page https://www.raspberrypi.org/learning/bu ... elly-baby/ ? (A link would have been helpful!)
bjb.png
bjb.png (8.22 KiB) Viewed 2021 times
I see no space other than the ones after "cp" and before "burp.wav".

choice.locks
Posts: 34
Joined: Fri Dec 25, 2015 8:51 pm

Re: Screaming jellybaby programming

Thu Dec 31, 2015 5:28 am

Yes correct
In terminal i have just received this error message
Which begins

Audio codec pcm_s24le channels 1 samplerate 48000 bitspersample 24
Subtitle count: 0, state: off, index: 1, delay: 0
Have a nice day ;)

End of message it did say have a nice day i havent added it

User avatar
rpdom
Posts: 15567
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: Screaming jellybaby programming

Thu Dec 31, 2015 6:24 am

That's not an error message. That's just omxplayer letting you know what it is doing. Yes, does always say "have a nice day ;)" when it finishes :)

If you are using an HDMI TV try forcing the sound to go through the TV like this:

Code: Select all

omxplayer -o hdmi burp.wav
If using the audio jack for sound, try

Code: Select all

omxplayer -o local burp.wav
instead.

choice.locks
Posts: 34
Joined: Fri Dec 25, 2015 8:51 pm

Re: Screaming jellybaby programming

Thu Dec 31, 2015 8:17 am

For both codes am getting

/usr/bin/omxplayer.bin: invalid option .. '0'

End of message
Both codes being entered into terminal
Tried under
pi@raspberry.pi $
And at
pi@raspberry $ jellybaby
)might be a typo in that sub directory in this coding illustration i am sending to you i dont have the instructions right in front of me at present

Return to “Beginners”