You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What is the specification of the duration value ? Does 1.0 represent a delay in seconds or something else like a quarter note for instance (i.e. the 'q' notation as used by play_song) ?
@dlech I've noted after asking that the example of the signature in the opening post shows "duration_ms". Since play_tone uses ms too, maybe we should keep the same unit (i.e. millis, not seconds) to be homogeneous.
First implementation done (was not a big deal, since the play_tone method being already there, so it was just a matter of getting the frequency for the passed note symbol).
I still need to do the appropriate work (fork + pull request) for submitting the changes. This will have to wait until tomorrow since time to go to bed now ;)
I've made some minor changes in a couple of place to remove PEP compliance warnings.
maybe we should keep the same unit (i.e. millis, not seconds) to be homogeneous.
It seems to me that in general, python uses seconds (e.g. time.sleep()), so that would be my preference. (and tone playback could be changed to match).
After some thinking, and because the underlying system commands use integer counts of milliseconds, using milliseconds everywhere seemed more appropriate.
Implementation is finished. Am I supposed to push my changes to the repo () ?
and because the underlying system commands use integer counts of milliseconds,
Part of the reason for adding this additional api is to decouple from the underlying system commands and do things more like the EV3-G software so that it is easier for people who are familiar with the LEGO software to make the transition to python.
@dlech Your point makes sense WRT how the LEGO SW presents it. I'll switch all durations to milliseconds.
However, there are also others delays which are specified in msecs, and which maybe will become a bit tedious to express as seconds, since representing short pauses (e.g. 50ms). How will users feel the obligation to write 0.05 for such quantities ?
@WasabiFan Thanks for the pointer. I already have an old fork, from the epoch I tried to collaborate a bit. Do you advise me to drop it and create a fresh new fork or can it be safely synced with the current status of the project ?
How will users feel the obligation to write 0.05 for such quantities ?
I don't know. So my inclination is to not think about it and make it like EV3-G instead of trying to guess what other people think or spending too much time discussing it.
From the musical point of view, the default note in the play_note EV3-G block ('A5' in the screen shot included at the top of this thread) should be set to 'A4'. A4 is the 440Hz reference widely used for instrument tuning, so it sounds (!) as a good default value.
I don't think so, since it has been implemented by the PR you just merged.
As I mentioned in replies in the PR thread, there are some comments in parts I've not written which would deserve to be reviewed and amended. But this is not very urgent, and can be left as is for the moment.
Activity
dwalton76 commentedon Nov 14, 2017
@EricPobot do you have the cycles to take a stab at this one? I don't know enough music theory to implement this :(
ericpascual commentedon Nov 14, 2017
@dwalton76 I'll give it a look ASAP (maybe tonight) and keep you updated.
I guess that "volume=100" means "volume at 100%". Right ?
EricPobot commentedon Nov 14, 2017
What is the specification of the duration value ? Does 1.0 represent a delay in seconds or something else like a quarter note for instance (i.e. the 'q' notation as used by play_song) ?
dlech commentedon Nov 14, 2017
duration is how long the note plays in seconds
EricPobot commentedon Nov 15, 2017
@dlech I've noted after asking that the example of the signature in the opening post shows "duration_ms". Since play_tone uses ms too, maybe we should keep the same unit (i.e. millis, not seconds) to be homogeneous.
EricPobot commentedon Nov 15, 2017
First implementation done (was not a big deal, since the play_tone method being already there, so it was just a matter of getting the frequency for the passed note symbol).
I still need to do the appropriate work (fork + pull request) for submitting the changes. This will have to wait until tomorrow since time to go to bed now ;)
I've made some minor changes in a couple of place to remove PEP compliance warnings.
dlech commentedon Nov 15, 2017
It seems to me that in general, python uses seconds (e.g.
time.sleep()), so that would be my preference. (and tone playback could be changed to match).ericpascual commentedon Nov 15, 2017
Agree. Let's align all involved methods to seconds. I'll integrate this in my changes.
EricPobot commentedon Nov 15, 2017
After some thinking, and because the underlying system commands use integer counts of milliseconds, using milliseconds everywhere seemed more appropriate.
Implementation is finished. Am I supposed to push my changes to the repo () ?
WasabiFan commentedon Nov 15, 2017
@EricPobot open a pull request and we can take a look.
EricPobot commentedon Nov 15, 2017
@WasabiFan I need some refresher : does it mean that I have to fork the project, then put my changes in this fork and issue a pull request from it ?
WasabiFan commentedon Nov 15, 2017
@EricPobot yep; see here: https://help.github.com/articles/creating-a-pull-request/
dlech commentedon Nov 16, 2017
Part of the reason for adding this additional api is to decouple from the underlying system commands and do things more like the EV3-G software so that it is easier for people who are familiar with the LEGO software to make the transition to python.
ericpascual commentedon Nov 16, 2017
@dlech Your point makes sense WRT how the LEGO SW presents it. I'll switch all durations to milliseconds.
However, there are also others delays which are specified in msecs, and which maybe will become a bit tedious to express as seconds, since representing short pauses (e.g. 50ms). How will users feel the obligation to write 0.05 for such quantities ?
I do not have a definite opinion on this point.
ericpascual commentedon Nov 16, 2017
@WasabiFan Thanks for the pointer. I already have an old fork, from the epoch I tried to collaborate a bit. Do you advise me to drop it and create a fresh new fork or can it be safely synced with the current status of the project ?
ddemidov commentedon Nov 16, 2017
This should be possible with
After this your local copy should be in sync with this one (the top commit in
git logshould be 923080b).ericpascual commentedon Nov 16, 2017
@ddemidov Many thanks for the detailed instructions. I'll give it a try tonight.
dlech commentedon Nov 16, 2017
I don't know. So my inclination is to not think about it and make it like EV3-G instead of trying to guess what other people think or spending too much time discussing it.
EricPobot commentedon Nov 18, 2017
From the musical point of view, the default note in the play_note EV3-G block ('A5' in the screen shot included at the top of this thread) should be set to 'A4'. A4 is the 440Hz reference widely used for instrument tuning, so it sounds (!) as a good default value.
Proposed implementation for issue #403 (#431)
dwalton76 commentedon Nov 23, 2017
@EricPobot anything else to do on this one?
ericpascual commentedon Nov 23, 2017
I don't think so, since it has been implemented by the PR you just merged.
As I mentioned in replies in the PR thread, there are some comments in parts I've not written which would deserve to be reviewed and amended. But this is not very urgent, and can be left as is for the moment.