Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Music extension blocks #135

Open
towerofnix opened this issue Jul 19, 2022 · 0 comments
Open

Support Music extension blocks #135

towerofnix opened this issue Jul 19, 2022 · 0 comments
Labels
support Leopard doesn't implement a Scratch feature

Comments

@towerofnix
Copy link
Member

Branching out from #18.

I think this is a mostly non-controversial extension to add support for, as its blocks are all present in both Scratch 1.4 and 2.0—it was only relegated to an extension (alongside Pen) in Scratch 3.0. So, implementing it means improving compatibility with not just current 3.0 projects, but also 1.4 and 2.0 projects. Anyone is welcome to let me know if they disagree though ^_^

Official support (reference implementation) is in LLK/scratch-vm, src/extensions/scratch3_music/index.js. Of particular note is the _playNote implementation. Also note there are a number of constants defined for mapping MIDI instruments and drum blocks to approximations in Scratch 2.0/3.0 (this is probably more relevant to sb-edit when importing 1.4 projects rather than adding these mappings to Leopard with one-to-one "MIDI set instrument" / "MIDI play drum" blocks/functions).

I also ported the MIDI drums with closer approximations in scratchfoundation/scratch-vm#1613, but we ended up not using that implementation because support for the effects chain was dropped (in the Music extension context). There was also potential for a fuller implementation with decay support, as mentioned in scratchfoundation/scratch-vm#1613 (comment). These are probably all outside the realm of support in Leopard, but I figured I'd share as interesting context for anyone who wants to write support for the Music blocks or try out an alternate approach from the one we decide on for Leopard in the end :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
support Leopard doesn't implement a Scratch feature
Projects
None yet
Development

No branches or pull requests

1 participant