GLOBAL SITE AUSTRALIAN SITE

Music | EdPy Programming | Forum

Please consider registering
guest

Log In Register

Register | Lost password?
Advanced Search

— Forum Scope —




— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters

Topic3
Music
November 23, 2016
4:39 pm
tdip
New Member
Members
Forum Posts: 2
Member Since:
November 23, 2016
sp_UserOfflineSmall Offline

The documentation on EdPy regarding Ed.TuneString suggests that R can be used in the string as a rest.12

However using R in the code below actually turns the Edison robot off.

song1 = Ed.TuneString(75, “c2R4c2g2g2a4b4o4a4g2z”)
Ed.PlayTune(song1)
while Ed.ReadMusicEnd()==Ed.MUSIC_NOT_FINISHED:
    pass

What am I doing wrong?

November 25, 2016
2:33 pm
Ben
Admin
Forum Posts: 179
Member Since:
August 24, 2015
sp_UserOfflineSmall Offline

Hi!

I have just tested your code, and it looks as though Edison is getting stuck in the rest.

When I added a line to your code:

Ed.LeftLed(Ed.ON)
song1 = Ed.TuneString(75, “c2R4c2g2g2a4b4o4a4g2z”)
Ed.PlayTune(song1)
while Ed.ReadMusicEnd()==Ed.MUSIC_NOT_FINISHED:
pass

Edison played the first note and then just sat there with the left led ON.

This seems like a bug.

Before I submit a bug report with our devs, can you please try my code and tell me what Edison does?

November 26, 2016
8:36 pm
tdip
New Member
Members
Forum Posts: 2
Member Since:
November 23, 2016
sp_UserOfflineSmall Offline

Hi Ben,

When I try your code, Edison does exactly what you said: played one note then just sat there with the left LED ON.

Thanks for following up on this,

Terry

November 20, 2017
10:24 pm
Paul
Member
Members
Forum Posts: 3
Member Since:
November 20, 2017
sp_UserOfflineSmall Offline

It is probably because you have written “75” in there, when the string is only 21 characters long.

November 30, 2017
10:12 am
Ben
Admin
Forum Posts: 179
Member Since:
August 24, 2015
sp_UserOfflineSmall Offline

Hi 

Paul, that syntax is fine, it simply creates space for a tune string that is longer the initial string.

This can then be manipulated later, for example, the following is very valid:

song1 = Ed.TuneString(7, "c2g2z")
Ed.PlayTune(song1)
while Ed.ReadMusicEnd()==Ed.MUSIC_NOT_FINISHED:
pass
song1 [0]='g'
song1 [1]='6'
song1 [2]='a'
song1 [3]='8'
song1 [4]='m'
song1 [5]='8'
song1 [6]='z'


Ed.PlayTune(song1)
while Ed.ReadMusicEnd()==Ed.MUSIC_NOT_FINISHED:
pass
December 7, 2017
6:01 am
Avatar
J
New Member
Members
Forum Posts: 1
Member Since:
December 7, 2017
sp_UserOfflineSmall Offline

tdip said
The documentation on EdPy regarding Ed.TuneString suggests that R can be used in the string as a rest.12

However using R in the code below actually turns the Edison robot off.

song1 = Ed.TuneString(75, “c2R4c2g2g2a4b4o4a4g2z”)
Ed.PlayTune(song1)
while Ed.ReadMusicEnd()==Ed.MUSIC_NOT_FINISHED:
    pass

What am I doing wrong?  

Just encountered this myself and on a hunch I used little r rather than capital R. It worked fine. I tried your code with little r and it worked.

March 8, 2018
6:37 am
Avatar
Pavel
Member
Members
Forum Posts: 3
Member Since:
March 8, 2018
sp_UserOfflineSmall Offline
Awaiting Moderation

  • Keep up with Edison

    Sign up for our newsletter to get all things Edison delivered straight to your inbox.

  • This field is for validation purposes and should be left unchanged.

Heads up

The Australian Federal Parliament has passed a law that extends goods and services tax (GST) to low value imports of physical goods imported by consumers from 1 July 2018.

This means that all customers purchasing Edison robots and accessories with an Australian shipping address must now pay GST. The GST will be automatically added to your purchase and show as a line item on your invoice.

We've detected that you are in Australia, so we wanted to let you know that we have changed your settings to view our Australian site, which displays GST inclusive pricing.

You can change back to the GLOBAL SITE at any time using the link in the top left of the page.

OK got it!    Take me to the GLOBAL SITE instead

Country

Pin It on Pinterest

Share This