generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Re: OP is an idiot

Previous Thread :: Next Thread 
turdulator is not online. turdulator
Joined: 22 Dec 2007
Total Posts: 383
15 Jul 2012 10:21 PM
Normally I'd do this myself, but time is short and I've other things to do with my code, but...

I would enjoy it if someone made a function for me that turned Integer input into the equivalent of a half-step (Input: 1 Output: 1 Halfstep) and then returned it for me.

i.g.

returnPitch = function(Input)
--fancy maths lolol
local output=resultoffancymathslololol
return output
end

returnPitch(1) would return the decimal equivalent (based on a base of 1) of a half step.

I've tried before and failed miserably (>emo corner), so I'd either love some assistance (I'm perfectly capable of turning knowledge into code), or if someone could just work some scrip-- magic* for me.

~Saz
Report Abuse
swimguy777 is not online. swimguy777
Joined: 30 May 2009
Total Posts: 17092
15 Jul 2012 10:26 PM
"In the twelve-semitone scale the frequency of the next semitone (halftone) is higher or
lower by the factor of twelfth root of two = 1.0594630943592952645618252949463."

The frequency of any given note is

440 * 2((n - 49)/12)

Where n is any note on the piano, 0 being A0, the lowest note, to 88 being C8, the highest note. You can even use numbers larger or smaller than this.

-[::ƧѡÎḾḠΰῩ::]-[::Maker of stuff and Helper of Scripting::]-
Report Abuse
turdulator is not online. turdulator
Joined: 22 Dec 2007
Total Posts: 383
15 Jul 2012 10:30 PM
Ehehe...

Eeh, what?

UNFORTUNATELY I'm creating a working GUITAR which has Slide, Bend, etc. functionality. Piano? What's that?

Most of that is there, and I have a sound to use with it, but...

You're going to have to dumb this down for me, I'm not a Einstein here, bro.
Thank you though.
Report Abuse
swimguy777 is not online. swimguy777
Joined: 30 May 2009
Total Posts: 17092
15 Jul 2012 10:32 PM
Plus, a half step can be up or down. And every note is a half step of two other notes, besides A0 and C8.

-[::ƧѡÎḾḠΰῩ::]-[::Maker of stuff and Helper of Scripting::]-
Report Abuse
turdulator is not online. turdulator
Joined: 22 Dec 2007
Total Posts: 383
15 Jul 2012 10:36 PM
Look; I'm a guitarist, not a mathematition...in.

Taking an article off of Wikipedia isn't helping me unless you're going to give me some cleaner numbers to work with.

I just need something tht takes ROBLOX's standard Pitch...

1...

Takes a number you input...

X...

And turn it into something I can add to ROBLOX's standard Pitch, and call that a half step.
Report Abuse
turdulator is not online. turdulator
Joined: 22 Dec 2007
Total Posts: 383
15 Jul 2012 10:39 PM
Ok, Nvm, I get it now.
I get numbers.

I'm an idiot, sorry.
Report Abuse
swimguy777 is not online. swimguy777
Joined: 30 May 2009
Total Posts: 17092
15 Jul 2012 10:43 PM
So, I've found out that a guitar has 22 frets. So 1 should be the highest note and 0 should be the lowest (should be, you may have to flip it around). So in theory you should just take the fret number over 22 and put that in as the pitch.

-[::ƧѡÎḾḠΰῩ::]-[::Maker of stuff and Helper of Scripting::]-
Report Abuse
turdulator is not online. turdulator
Joined: 22 Dec 2007
Total Posts: 383
15 Jul 2012 10:59 PM
You'd think it'd be that easy but it's not.

There are 6 strings; Each string can be tuned differently to create a different base note.

I can handle different base tunings by converting from Standard Tuning (EADGBE); but ROBLOX itself produces several issues:

The best sounds that can be used for this never stack up. If you attempt to play more than one at once, it creates a sound akin to a force being ran along a cheese grater.

I'm working to combat this too, but in all honesty it's giving me some real attitude, and it may just be the fact that ROBLOX needs better sound bytes.

But yeah; Basically the script that works (outside of it's other advanced functions) for the guitar gives you a nice GUI which can be played by by hitting keys on your keyboard or by clicking the different frets (not implemented yet, might not since this is a stupid way to play) (kind of like a virtual guitar), and gives you other menus which contain options to tune your strings, etc.)

It can also be used as a sort of MIDI-builder / player, but the only use for that is creating chords, and as discussed earlier that creates a sound worse than JB's latest hit single.

It should be fun; and it is, I'm already losing hair!
Report Abuse
mamaguy is not online. mamaguy
Joined: 07 Oct 2010
Total Posts: 7073
15 Jul 2012 11:09 PM
^puberty
Report Abuse
turdulator is not online. turdulator
Joined: 22 Dec 2007
Total Posts: 383
15 Jul 2012 11:12 PM
^Go back to RT
Report Abuse
turdulator is not online. turdulator
Joined: 22 Dec 2007
Total Posts: 383
15 Jul 2012 11:23 PM
Built off of what the only helpful guy who posted on here has told me,

ReturnPitch=function(n)
return (440 * (2*((n - 49)/12)))
end

is what I've come up with.

Then I tried:

ReturnStep=function(n)
return (440 * (2*((n)/12)))*.001
end

Simply because ReturnPitch() only gave out confusing numbers which appeared to be FREQUENCY, which is not what I'm looking for.

The only time I need frequency is when I'm getting a sound byte's initial note, which I can get easily with Audacity.

Toying with it a bit gave me something which appears to put out a half a step.

I'll give you some numbers to work with, help me find out that I'm doing it wrong:


2 = 0.14666666666667
4 = 0.29333333333333
6 = 0.44
8 = 0.58666666666667
10 = 0.73333333333333
12 = 0.88
14 = 1.0266666666667
16 = 1.1733333333333
18 = 1.32
20 = 1.4666666666667
22 = 1.6133333333333

I'll run some more tests and get back.


Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image