Closed Helen09 closed 5 years ago
We are using fixed instances now to handle sounds so tutorials have to be updated.
The situation is that this project wants to compose a sound (where the sound string is filled in a later step) and uses the now deprecated playSound block. The new melody blocks don't support a custom sound string.
The new play block has he exact same text as playSound. So, the coding steps won't work with the available blocks. We'll need to get rid of the "twinkle" sound or have the user to stay in JS only.
let twinkle = ""
music.playSound(twinkle)
music.baDing.play()
The customizable api was nice. This is an issue.
Maybe a melody editor, makes one byte notes packed into Buffer
... sometime later, over the horizon.
It perfectly acceptable to instantiate a new Melody and play it. We should have a block that takes a string.
From: Galen Nickel notifications@github.com Sent: Thursday, April 18, 2019 1:25 PM To: Microsoft/pxt-adafruit pxt-adafruit@noreply.github.com Cc: Peli de Halleux jhalleux@microsoft.com; Comment comment@noreply.github.com Subject: Re: [Microsoft/pxt-adafruit] A "twinkle" variable from "variables" can't be put into "play sound" (#985)
Maybe a melody editor, makes one byte notes packed into Buffer... sometime later, over the horizon.
— You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FMicrosoft%2Fpxt-adafruit%2Fissues%2F985%23issuecomment-484677282&data=02%7C01%7Cjhalleux%40microsoft.com%7Cf590a523870442bc7aff08d6c43bfe15%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636912159282959924&sdata=q5qi0m3pjBleg2bfL9fZoCirRk4caXzxE4oJnyVQTSY%3D&reserved=0, or mute the threadhttps://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAA73QKMPJFNKU43CEIS47MLPRDKLLANCNFSM4HDHCRHA&data=02%7C01%7Cjhalleux%40microsoft.com%7Cf590a523870442bc7aff08d6c43bfe15%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636912159282959924&sdata=1PqhG1pfy9tEy5jz%2FbQtjOpq9xZEEL63Jhens%2FoDrFo%3D&reserved=0.
Yea, maybe add a helper to create it that takes a string: let song = createMelody("e:2 b:4")
?
Will not work with fixed instances...
Change melody up a bit to do...
//% fixedInstances
export class StaticMelody extends Melody {
}
export class ComposedMelody extends Melody {
}
...except compile the melody on create rather than in play()
in order to not retain the bulky melody string.
@ganicke we are planning to release this today. Sorry for the late notice. Is it possible to generate a PR for these tutorials. As soon as the release is done, we will merge the PR.
Hmm ignore my comment. I don't know what we can do here.
OK, I'm fixing the others now...
Describe the bug A "twinkle" variable from "variables" can't be put into "play sound"
Steps to reproduce the behavior
Expected behavior Drag a "twinkle" variable from "variables" into the "play sound" where is says "power up"
Actual behavior A "twinkle" variable from "variables" can't be put into "play sound"
Additional info: