Skip to content

Ed.PlayTune () cannot play REST, it breaks the tune #10

@PSLLSP

Description

@PSLLSP

EdWare can play Tunes with "rest notes" and this tune plays nice:" f3R1c3R1a3R1f3"

EdPy has some bug and cannot handle R for Rest in tune string. Rest note is documented in documentation in Ed.TuneString() and Ed.PlayTune() but there is no example of tune string with "REST" note.

https://meetedison.com/content/EdPy-app-documentation-guide.pdf

This is demo, note that tune2 and tune3 is not played as expected:

#-------------Setup----------------
import Ed

Ed.EdisonVersion = Ed.V2

Ed.DistanceUnits = Ed.CM
Ed.Tempo = Ed.TEMPO_MEDIUM
#--------Your code below-----------

Ed.TimeWait(1, Ed.TIME_SECONDS)        

tune1 = Ed.TuneString(9, "f4c4a4f4z")         # OK
tune2 = Ed.TuneString(15, "f4R6c4R6a4R6f4z")  # BUG is here, only the first note is played
tune3 = Ed.TuneString(13, "f4c4R6a4R6f4z")    # BUG is here, only first two notes are played

Ed.LeftLed(Ed.ON)
Ed.RightLed(Ed.OFF)
Ed.PlayTune(tune1)
while Ed.ReadMusicEnd() == Ed.MUSIC_NOT_FINISHED: pass
Ed.TimeWait(1, Ed.TIME_SECONDS)        

Ed.LeftLed(Ed.OFF)
Ed.RightLed(Ed.ON)
Ed.PlayTune(tune2)
while Ed.ReadMusicEnd() == Ed.MUSIC_NOT_FINISHED: pass
Ed.TimeWait(1, Ed.TIME_SECONDS)   

Ed.LeftLed(Ed.ON)
Ed.RightLed(Ed.ON)
Ed.PlayTune(tune3)
while Ed.ReadMusicEnd() == Ed.MUSIC_NOT_FINISHED: pass
Ed.TimeWait(1, Ed.TIME_SECONDS)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions