A Musical Upgrade Suggestion!!

I was trying to compose a song in Snap!, but evidently the program is not optimized to handle lots of notes being played at once because on occasion they tend to desync due to lag (most noticeable while scrolling through the scripts) which completely defeats the purpose of trying to compose background music. As far as I know, there is no way to keep all the notes in time, so my request is that a set of music composition blocks be added to the block libraries which are optimized for music, and allows for chords to be played without having to use the do in parallel block. Here are my specific requests:

  • General optimization for sound

  • Better sound quality for the default instruments in the set instruments block, especially the sine wave which is nearly inaudible at lower frequencies. I suggest adding them to a new set instrument block under the denomination 'wave functions', mentioned below.

  • Either mute the sound or allow sound blocks to run in the background so that it doesn't just drone when Snap! is out of focus.

  • Upgrading the UI of the play note block to match that of the new chord block mentioned below.

  • A play chord block, similar to a play note block, in which a user can select any chord or note in any octave and any combination of octaves and can choose the number of beats the chord is played. The chord block, when clicked, should play the chord and report it in standard musical notation, i.e.Csus2, Dmaj, etc. This block should also be able to input and output combined unicode and list information for chord selection. There should be a visual keyboard in the UI like the play note block, but perhaps with a larger range of notes, and a way to select a higher or lower octave.

  • New set instrument and set drum blocks which can be relabeled as one another.
    * The new set instrument block should be set to a piano by default and should also include a few other denominations of instruments such as, but not limited to, brass, woodwinds, percussions, strings, synthes, etc. I suggest having two separate drop down menus in the instrument block, one for the denomination, and another for the individual instrument so that instrument are easier to navigate. I also suggest having 3-4 octave ranges for all denominations, for example having everything from a trumpet to a tuba in the brass denomination and everything from a flute to a contra bassoon (which is actually 5 octave ranges) for the woodwinds. The percussions xylophones, triangles, anything that is not a wind or string instrument that doesn't fit into the category of being a drum.
    * The set drum block should only be able to play one note at a time. It should have everything from a bongo to a bass drum as well as a full drum kit including snares, hihats, cymbals, toms, etc. If a chord block with more than one note is played after a drum block, the sound played defaults to the highest note or no sound is played (or what ever else is decided).
    * Include all sounds as 'sounds' in the set instrument block

  • A voices block that should accept play note, play chord, rest, set instrument, or set drum blocks, and should be able to play multiple chord, note, and rest blocks in parrallel, similar in function to the do in parallel block except that additional areas for blocks (voices) can be added or removed with vertical arrows. The voices should be labeled as voice(1), etc., and should be able to be relabeled. The user should be able to change the time signature and key signature somewhere at the top of the block, and it should force all notes and chords to be played in time. The time signature should be visually displayed with tick marks for each individual voice. If no set instrument block is placed in the voices block, the sound played is a pure frequency (or frequencies) in hertz. Each voice starts out with a slot for a sound block; if one of the previously mentioned blocks is placed there (or any other sound block) it will visually change to a reporter block with an arrow pointing to the right attached to it, and a new opening for another sound block will appear. The instructions will then be executed from left to right instead of the normal direction of execution from top to bottom. The next function will not be triggered until all voices have executed their entire string of blocks.
    * A metronome block which loops once triggered and turns off when triggered again. It can be played on its own or can be synchronized with a voices block mentioned above.
    * A transpose block which can hold play note or play chord blocks which transposes them based on the key signature, otherwise the chords and notes are not transposed.

There may have been some things I overlooked, but I think that encapsulates the general idea of improving the musical composition in Snap!

Edit: I forgot to mention that the measure numbers should be displayed where there are tick mark within the voices block.

1 Like

Hi, welcome to Snap!!

That all sounds great. It seems to me at first glance that if you had a way to keep voices in sync, you could build a lot of the rest in Snap! itself. Something like a "bar" block that you'd put in each voice at every measure boundary. Then you'd have a "metronome" script that would broadcast a "bar" message every so many milliseconds. If a script got to a bar early, it would wait for the signal; if the signal came before the bar, the script would just jump to the next bar right away.

Maybe even that could be written in Snap!, using continuations?

But let's see what @jens says about his plans for music.

1 Like

I am fairly new to Snap!, so I have not yet used continuations. I will take your advice into consideration. I'll read up on some of those thing in the manual. Thanks for the quick reply!

Do you have any suggestions pertaining to all the different new sounds in my version of the set instrument block?

Nah, you want Jens, he's the musician. All I know about music is that it all comes from England and happened between 1964 and 1968. :~)

lol okay Ill ask him.

Synching works best in turbo mode, because it greatly increases the scheduler's resolution. Are you taking our free MOOC "From Media Computation to Data Science"? In it we're dealing with most of the iceas you're suggesting, especially how to make "play chord" and "play song" blocks to compose "real" music.

https://open.sap.com/courses/snap2

More and better instruments are on our list for the not-too-distant future. But in the course we'll also show you how to synthesize your own instruments.

2 Likes

Why don't they just routinely build MIDI synthesizers into computers these days? How much could it cost, if Intel etc. built their own?

3 Likes

I tried using turbo mode with this setup, but it still lagged

well, let me once again recommend our course for this :slight_smile:

1 Like