Skip to content

Support Music extension blocks #135

Open
@towerofnix

Description

@towerofnix

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 :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    supportLeopard doesn't implement a Scratch feature

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions