News:

NinSheetMusic is 18 years old!

Main Menu

NSM Sound Utilities [April 2, 2017]

Started by PetrifiedLasagna, June 09, 2016, 10:03:05 PM

Previous topic - Next topic

PetrifiedLasagna

Hello all you NSM users, have I got something special for you! Now for those of you who don't know, I am an avid programmer. Like, it's my career choice, so you would expect that I would to code until I pass out.

Anyways ::), I am in the middle of developing several utility programs to make your transcription process all the more easier. Not only that, but I am going to give it to you in pure JavaScript. Yep, absolutely no third party plugins will be required to run these applications so all you really need is a respectable browser where the developers keep it up to date with W3 standards (Firefox, Google Chrome, Safari?).

I will also have all of the code available on GitHub for anybody who wishes to contribute to the cause.

Current projects:

- Flux Capacitor (GitHub) (Live Demo)(30%-40%)
info
This program will allow you to listen to an audio file of your choosing, while allowing you to change the playback speed. The catch is that it needs to do this without modifying the original pitch of the file. I am to make this as high quality as possible, i.e. minimize audio "whooshing" at low speeds for maximum usability.

Currently, this can load a local file specified by the user which can then be played. UI elements currently have no effect so no controlling speed. :P
[close]

- Virtuoso (GitHub) (Live Demo)(60-70%)
info
This idea is actually based on an old application that I was writing that would load a midi and then save a video file of it being played. I never finished that, but I am pretty familiar with the midi format, and it will be a lot easier to implement animating keys on this. The only thing I won't be able to do is video recording, so that part is up to the user.

This program has come a long way and has become so much more useful now, with features such as

- Load midis directly off your computer
- No connection needed once the page is loaded. Can even be downloaded to your computer
- Responsive note playback (velocity, sustain, realistic falloff and volume scaling)
- Displays the key, tempo, and sustain info
- Can start, stop, and set the time that the song will start playing at
[close]

NSMetronome (GitHub) (Live Demo - nsmdevsite) (Live Demo) (70%-80%)
info
A very simple tool similar in functionality to all8's bpm calculator. Instead of the live demo linking to my website, I have decided to show you guys that these can be readily integrated into for easy access.
[close]

Have any ideas for a cool tool? Post in the comments below and I will try to get back to you with some blueprints (design considerations, and that stuff) as soon as possible.

All live demos are hosted on my script hosting server.

Tobbeh99

I really appreciate your efforts. But in terms of tools for arranging, I think the combination of Audacity+Audiostretch definitely is enough to arrange any kinds of songs. With Audacity you can manipulate the audio file a lot, boosting bass/treble, raising/lowering the entire file 1 or more octaves up or down, and also equalizing the song. And with Audiostretch you can slow down a song to 0%, where it just stops on that very moment, you can even go pass that to minus %, but there's really not a reason to do that.

So I don't really have any idea of anything I'd need for arranging.
Quote from: Dudeman on August 16, 2016, 06:11:42 AM
tfw you get schooled in English grammar by a guy whose first language is not English

10/10 tobbeh

E. Gadd Industries

Whoa! This is cool! I would definitely use Virtuoso for when I start uploading my sheet tutorials to YouTube!
"Everyone is crazy but me"
-The Sign Painter


The entrance to my lab is hidden... somewhere...
Spoiler

[/spoiler
[close]

PetrifiedLasagna

Quote from: Tobbeh99 on June 10, 2016, 03:55:14 AMI really appreciate your efforts. But in terms of tools for arranging, I think the combination of Audacity+Audiostretch definitely is enough to arrange any kinds of songs. With Audacity you can manipulate the audio file a lot, boosting bass/treble, raising/lowering the entire file 1 or more octaves up or down, and also equalizing the song. And with Audiostretch you can slow down a song to 0%, where it just stops on that very moment, you can even go pass that to minus %, but there's really not a reason to do that.

So I don't really have any idea of anything I'd need for arranging.

I understand what you mean. I myself use Audacity and Audiostretch, but in terms of user-friendliness, Audiostretch is definitely lacking. Just from using it, I have come up with ways that some of the quirks could have spawned. Also, with only increments of ten I have found that it is not enough for 16th/32nd notes.

Just picture me listening to the same 2-3 second clip over and over again trying to pinpoint those speed demons. I just finished the advertise theme from bomberman 64 and that is loaded with 16ths at 190 bpm!  :o

As a programmer, I always want to ensure that the things I create fulfill the users needs (NSM in this case) without forcing them to deal with bugs or poor design choices. If you told me there was something wrong with my code without telling me specifically, I would immediately start reading every line of code, and using the application in an attempt to find it.

Also, typo in OP. I meant to say "without the use of plugins."  :P

Maelstrom

Quote from: PetrifiedLasagna on June 10, 2016, 11:11:48 AMAlso, typo in OP. I meant to say "without the use of plugins."  :P
Ooo. What will you be using?

PetrifiedLasagna

Just some gold old-fashioned JavaScript.

PetrifiedLasagna

Okay guys, first live demo is up and running. It's not pretty now, but I will be making a lot of updates now that I have the audio engine down.

Dudeman

Well, I can certainly load in an audio file. This appears to be coming along nicely. I hope you're able to implement the other elements soon.
Quote from: braixen1264 on December 03, 2015, 03:52:29 PMDudeman's facial hair is number 1 in my book

PetrifiedLasagna

Just throwing this out there so I don't forget. Feel free to correct me if I have it wrong.

Do not read if you hate research papers  ;)
Begin Memo on pitch/frequency
Pitch/Frequency are a function of wavelength, therefore by maintaining pitch you are also maintaining frequency. The "easy" methods of changing the speed of sound result in a proportionally different frequency than what the original audio had. For example, doubling the sample rate will also double the frequency since the samples will be played twice as fast. Same thing if you halve the length of the audio and go over every other audio sample (although in this case there is a loss of data).

Several tests have provided insight into how a slowed down effect can be achieved. In audacity, when a short noise sample with some silence for padding can have the "change tempo" effect applied to it, with some interesting results. The sound becomes extremely choppy and it is possible to see that this sample was mixed with the surrounding silence.


Hypothesis:
Therefore, in order to slow down audio without changing frequency, for every so many steps that are taken forward you must take a proportional amount of steps back. So in order to say, halve the speed of a sample, if you parsed through 8 sample, you would then go back 4 samples, parse 8 samples and so on.

This could be similarly be achieved in a streaming fashion by taking a timer value T, and playing T through T + constant C(e.g. 48), but then only setting T to T + C * percentage P (1% - +100%). This will likely result in choppy audio at very low speeds and will probably need some tweaking.


End Memo
[close]

It is to late for me to be thinking this intensely.  :'(

BlackDragonSlayer

Ooh, sounds neat! Haven't checked out the demo yet, but I'll definitely be interested in seeing the finished product!
And the moral of the story: Quit while you're a head.

Fakemon Dex
NSM Sprite Thread
Compositions
Story Thread
The Dread Somber

Maelstrom

This may sound like a strange request, but could eventually put in a compact vertical mode so it'd be easy to have finale open and this on the side?

PetrifiedLasagna

Quote from: Maelstrom on June 12, 2016, 09:05:28 AMThis may sound like a strange request, but could eventually put in a compact vertical mode so it'd be easy to have finale open and this on the side?

This actually responds to the size of the window (or phone screen).  ;)

If anyone has an iPad, feel free to try it. It should definitely work on there, although I have heard that the first JavaScript sound that is played will be ignored, so you may have to press the play button twice.

PetrifiedLasagna

Quote from: PetrifiedLasagna on June 12, 2016, 11:48:41 AMIf anyone has an iPad, feel free to try it. It should definitely work on there...

Wow, I can't believe that I actually uttered such an ignorant sentence... Although I did post at like 1-2 in the morning :P
Maybe if I add the ability to use files from the web that it will be possible to use on a tablet.

Anyways, I have another update out. Most of the UI elements that there will be in the future have been added. This includes
- File status
- Time
- Time controller

Also, all of the UI elements that are present are operational. I currently have an algorithm that can apply pitch-perfect audio slowing, but it is not the best quality. Basically what I do is every time the number of samples parsed exceeds the Constant multiplied by the speed percentage, I will go back to the first sample that was parsed. It gets the job done, but it is not the best. I will post the code snippet below, so it is easier to see what it does.
Spoiler
//c is the current channel being parsed
//i is the current sample
//nTime is equal to a constant value OR the distance from the end of the file
//controls.speed is the percentile speed (1.0 to 0.0)

if(i > 0 && (i-ioffs > nTime * controls.speed)){
  ioffs = i;
}

destinationBuff[c][i] = audioData.data[c][(i - ioffs) + offs];
[close]

The live demo has already been updated

PetrifiedLasagna

I am slow close to figuring out a good algorithm to slow the audio down. I know it is just sitting in front of me right now and I don't see it.  :-\

Also, look forward to having no choppy playback in the next update since I added a scheduler.

mikey

maybe now is a good time for a break.  Look at it with fresh eyes :P
unmotivated