Audio timing

In this project I tried to play a Samba Reggae rhythm witch consist of four simultainiously playing audio samples. I tried to shorten the sample size, turbo mode on/off but the timing really quickly gets sloppy...
Eventually got this project to work with the help of Tunescope. Surdo and Caixa with Tunescope and the Agogo Bells. playing as standard audio files.
My wish would be to play this rhythm without the help of the Tunescope library.

Any advice is welcome. Thanks

Why is that?

It would be great for Snap! if all audio was handled by one library :slight_smile:

This is a fantastic project! Thanks so much for sharing it.

It is true that loading the TuneScope library adds some overhead. Is there a feature you would like that TuneScope does not support, or would you just like a more lightweight solution?

Regarding synchronization across notes and parallel tracks, it has taken the TuneScope team about four years to get reasonable synchronization across tracks, and it still is not perfect. The technical members of the TuneScope would better be able to explain the issues involved.

That said, if you are not using the "Play Note" block, you may be able to export just the specific TuneScope blocks that you are using, and reimport them. Again, one of the CS members of the team would need to take a look at that possibility.

At any rate, we'll definitely share this demonstration with the TuneScope team at their weekly meeting on Monday morning ... they will be impressed and delighted!

If you haven't already seen this, here is a resource that may be of interest:

https://maketolearn.org/musical-rhythms/

@glenbull thank you for you’re comment and for creating TuneScope. My first intention was to create this project with only the primitive sound blocks to get students familiar in working with the sound blocks. I don’t want to scare them in their first lesson to import and use the (many) blocks from the TuneScope library.

With Snap’s primitive sound blocks the timing gets quickly floppy…maybee that’s why the category is called sound and not music. With succes I tried to build the rhythm with TuneScope, but still in doubt to hand this idea to the students. If I’m correct, TuneScope is midi based and sounds more “robotic” then when audio files are used. I agree with @cymplecy two sound libraries is confusing especially when they depend on each other. (Tempo) My suggestion would be to create one sound library with lesser blocks : 1 basic audio en 2 basic midi category and put the other blocks in a separate library.

I have seen this, thank you it’s wonderful. :musical_note:

We're collaborating with Gerald Ardito, a CS prof at Manhattanville College, who is developing week-end workshops for high school students using TuneScope.

I'll follow up with him to see if he has some thoughts about a low-overhead introduction that would be engaging to a novice in the context in which you are working.

Thanks, also, for your other suggestions.

P.S. Do you, by chance, know Joke Vogt at the University of Amsterdam?

I try something with broadcast block just for fun. Can you tell me if the result is better.

samba_audio_test

I just remembered that I was actually able to create music with the music blocks, and I actually got them to sync up. Here's the project (btw, I edited the xml of some blocks).

https://snap.berkeley.edu/snap/snap.html#present:Username=ego-lay_atman-bay&ProjectName=smb%20overworld%20theme

(just ignore all the extra stuff, I was just messing around)

Now, there are some differences, I'm having all the notes play in the same sprite, and I'm using the play note block (in snap, not tunescope (this was before tunescope)). It also needs turbo mode to be on.

Actually, here's the code that plays the notes

edit: actually, this is only for playing a chord, not different rhythms at the same time, but maybe it can be achieved with a similar technique.

Another edit: I was able to modify my code to use sounds instead

Thanks, but not really the rhythm is still to floppy and not tight enough. Here I created a sample with the use of TuneScope.

Thanks, will try this when I get back from work.

Thanks Glenn, looking forward to the replies, I don't know Miss Voogt. Perhaps it helps and idea as followup on the previous ideas?... To ask Snap to only work when libraries are imported...every block categorie in this sense becomes a library when used it has to be imported. A natural addition, followup on Scratch.

Can you share this snap code with us (using tunescope)

Yeah, synchronizing sound (or “music”) is a well-known issue in Snap!, good solutions deserve to be shared.

synchronizing music in Snap! is similar to synchronizing musicians in an orchestra: You want a conductor! As in orchestral scores it's a good idea to break up music into little chunks the size of a measure. Your "conductor" script then broadcasts messages that trigger each measure to play.

If, OTOH, you use loops the same thing will happen, that happens to an orchestra whose musicians don't look up at the conductor :slight_smile:

@qw23 Here the project using Tunescope for the Surdo and Caixa and wav audio files for the Agogo Bells. (Do not run it in turbo mode)

Created a timer for the Surdo sound file, It's not much but eventually after 50 times my one man orchestra thinks differently.