The thread is outdated and most things aren't going to work, better refer to osbpy wiki, it explains everything, has examples and is written for updated version of osbpy.
Hello everyone. I'm here to present you my new project called osbpy. You probably heard about SGL and maybe made a storyboard in it. I even created a guide for using it. However, it's not a real programming language, therefore you cannot do anything you want, you can't even import basic libraries. Experimenting with it for long time inspired me to make something simplier, more powerful and fully customizable.
osbpy is a simple Python file (some may call it library) that contains all storyboard functions listed here and here. That basically allows you to use all functions in SGL with much more freedom as you're only limited with Python, which is really wide. At the top of that, it contains spectrum function - because you have access to everything, it'll allow you to do things like this, it also can adjust maximum height and minimum height, so for loud songs, it wouldn't jump like insane and for quiet songs, it would still be pretty visible.
As I already mentioned, osbpy is coded in Python. That requires you to have it installed. Apart from that, you'll need some libraries to make it work, you can install them with few steps. Please, mention that osbpy is coded for Python 3.5.1, some features may not work on older versions or in new releases.
First of all, download Python from their official website. Install it, preferably with default settings, "Add Python 3.5 to PATH" must be ticked! If using custom installation, leave pip installed too.
After Python is installed, we'll need to install all libraries that osbpy is using. First one will be Numpy, which is mathematical library which is required by other libraries we are using. You can get numpy here. Be aware you need +MKL version (vanilla won't work with scipy) and be sure it is cpxx fits your version of python, we have 3.5, so it must be cp35, 32bit/64bit version must fit your Python too!
Another library you need is scipy, this is to load audio files so another library can work with it properly. Lastly, you need matplotlib, which is another mathematical library, which allows you to make graphs - these are very useful to obtain spectrogram data etc.
All libraries are available here for Windows, both 32 and 64bit versions:
After downloading numpy, matplotlib and scipy for your version of Python, open up a command prompt. That can be done by using WindowsKey+R, typing in 'cmd' (without quotation marks) and pressing enter. Or you may find it if you simply press WindowsKey and write 'Command Prompt'. You have to install the Wheel (.whl) files. This is why unticking pip in Python installation would break everything, it's here to install them. To install them, just simply write 'pip install nameofpackage.whl' - You're most likely not in the same folder, so you need full path to the whl file. You can just write 'pip install ' and then drag the file into command prompt window, it will put in the whole path. At the end, you should run only three commands similar to those below.
Usage of osbpy is not difficult at all. Download osbpy and extract it into folder where you plan to have code files for your storyboards.
Now to make storyboard code, you need some basic programming skills. If you don't know Python, I recommend you to check out some tutorials or Codecademy, it's really cool if you want to learn basics of Python quickly. After all, everything you'll need to know are loops anyway. Python is very simple language and anyone can learn it in few days if he was never programming before.
Now, you have two options, edit osbpy.py directly and manage everything on your own. However, I don't recommend this - You may experiment with the code, but doing it unless you are unexperienced won't bring you anything good. Easier way would be importing the file. That means, you need some text editor, it may be for example Sublime Text, but you can run it even in simple Notepad. Please note that once you save a file as .py, you can right click it and "Edit with IDLE" will appear. If you want to have a little bit better view, edit your file with this - good thing is you can even run file with it if you press F5. To import the file, just simply save it in same folder as osbpy.py and put this line at the start of your file:
osbpy is a simple Python file (some may call it library) that contains all storyboard functions listed here and here. That basically allows you to use all functions in SGL with much more freedom as you're only limited with Python, which is really wide. At the top of that, it contains spectrum function - because you have access to everything, it'll allow you to do things like this, it also can adjust maximum height and minimum height, so for loud songs, it wouldn't jump like insane and for quiet songs, it would still be pretty visible.
First of all, download Python from their official website. Install it, preferably with default settings, "Add Python 3.5 to PATH" must be ticked! If using custom installation, leave pip installed too.
After Python is installed, we'll need to install all libraries that osbpy is using. First one will be Numpy, which is mathematical library which is required by other libraries we are using. You can get numpy here. Be aware you need +MKL version (vanilla won't work with scipy) and be sure it is cpxx fits your version of python, we have 3.5, so it must be cp35, 32bit/64bit version must fit your Python too!
Another library you need is scipy, this is to load audio files so another library can work with it properly. Lastly, you need matplotlib, which is another mathematical library, which allows you to make graphs - these are very useful to obtain spectrogram data etc.
All libraries are available here for Windows, both 32 and 64bit versions:
After downloading numpy, matplotlib and scipy for your version of Python, open up a command prompt. That can be done by using WindowsKey+R, typing in 'cmd' (without quotation marks) and pressing enter. Or you may find it if you simply press WindowsKey and write 'Command Prompt'. You have to install the Wheel (.whl) files. This is why unticking pip in Python installation would break everything, it's here to install them. To install them, just simply write 'pip install nameofpackage.whl' - You're most likely not in the same folder, so you need full path to the whl file. You can just write 'pip install ' and then drag the file into command prompt window, it will put in the whole path. At the end, you should run only three commands similar to those below.
pip install C:\Users\Wafu\Downloads\numpy-1.10.4+mkl-cp35-none-win32.whlPath will differ depending on where you saved the files and which version did you download. For Python 3.5.1, if you installed it from scratch, it should install them properly and you'll be ready to go!
pip install C:\Users\Wafu\Downloads\matplotlib-1.5.1-cp35-none-win32.whl
pip install C:\Users\Wafu\Downloads\scipy-0.17.0-cp35-none-win32.whl
Now to make storyboard code, you need some basic programming skills. If you don't know Python, I recommend you to check out some tutorials or Codecademy, it's really cool if you want to learn basics of Python quickly. After all, everything you'll need to know are loops anyway. Python is very simple language and anyone can learn it in few days if he was never programming before.
Now, you have two options, edit osbpy.py directly and manage everything on your own. However, I don't recommend this - You may experiment with the code, but doing it unless you are unexperienced won't bring you anything good. Easier way would be importing the file. That means, you need some text editor, it may be for example Sublime Text, but you can run it even in simple Notepad. Please note that once you save a file as .py, you can right click it and "Edit with IDLE" will appear. If you want to have a little bit better view, edit your file with this - good thing is you can even run file with it if you press F5. To import the file, just simply save it in same folder as osbpy.py and put this line at the start of your file:
from osbpy import *
This imports osbpy into your code so you can use all the commands. Now, the main code comes in, you are free to use all of following commands + regular Python:There is list of all objects definited. It's called obj. Each object has its index (number) and then commands. First, you start with defining whether it's animation or static sprite:
obj[index] = stat(path,layer,origin,posX,posY)
obj[index] = anim(path,layer,origin,posX,posY,framecount,framerate,loop)
Green ones must be string, strings have quotation marks, like "this is random text". Index can be any number, e.g. obj[0] = ... However, if building spectrum, reserve first indexes depending on how many bars do you want, otherwise you'll overwrite spectrum or your old objects. For example if you want 20 spectrum bars, put your first object on obj[21] etc.
please note that you need to merge it with certain object in objects, use += instead of =
obj[index] += fade(easing,startTime,endTime,startFade,endFade,loop)
move(easing,startTime,endTime,startmoveX,startmoveY,endmoveX,endmoveY,loop)
moveX(easing,startTime,endTime,startmoveX,endmoveX,loop)
moveY(easing,startTime,endTime,startmoveY,endmoveY,loop)
scale(easing,startTime,endTime,startScale,endScale,loop)
vecscale(easing,startTime,endTime,startscaleX,startscaleY,endscaleX,endscaleY,loop)
rotate(easing,startTime,endTime,startRotate,endRotate,loop)
color(easing,startTime,endTime,startR,startG,startB,endR,endG,endB,loop)
para(easing,startTime,endTime,parameter)
When your code is done, you need to save data to some file. Put this line at the end of your code:
end("anyfileyouwant.osb")
For more reference, wiki can help you too, if you don't know what values are acceptable. If you want to report issue, be sure to PM me or use GitHub
Feel free to ask me anything you need, I'll be always here to help you out. I'll be sharing all my storyboard codes here, just so you have some examples.obj[index] = stat(path,layer,origin,posX,posY)
obj[index] = anim(path,layer,origin,posX,posY,framecount,framerate,loop)
Green ones must be string, strings have quotation marks, like "this is random text". Index can be any number, e.g. obj[0] = ... However, if building spectrum, reserve first indexes depending on how many bars do you want, otherwise you'll overwrite spectrum or your old objects. For example if you want 20 spectrum bars, put your first object on obj[21] etc.
- path = Where the file is stored, for example "SB/image.png"
- layer = "Background","Fail","Pass","Foreground"
- origin = "TopLeft","TopCentre","TopRight","CentreLeft","Centre","CentreRight","BottomLeft","BottomCentre","BottomRight"
- posX, posY - Position on X and Y axis
- framecount - How many frames does the animation have. e.g. if you use 3, it will loop image0.png, image1.png and image2.png
- framerate - How many ms does it take to change between frames
- loop = "LoopForever","LoopOnce"
please note that you need to merge it with certain object in objects, use += instead of =
obj[index] += fade(easing,startTime,endTime,startFade,endFade,loop)
- easing = Determines speed changes of the action, put in number easing
- startTime - Self explanatory, when do you want the action to start in ms
- endTime - When do you want the action to end in ms
- startFade - Fade value at start (0.0 - 1.0)
- endFade - Fade value at end
- loop = Type in just True of False, depending on whether it's part of loop. This must be true for objects which come trigger() or loop(), if you use False, it will end trigger() or loop(). If empty (recommended unless you use trigger()/loop()), it's set to False.
move(easing,startTime,endTime,startmoveX,startmoveY,endmoveX,endmoveY,loop)
moveX(easing,startTime,endTime,startmoveX,endmoveX,loop)
moveY(easing,startTime,endTime,startmoveY,endmoveY,loop)
scale(easing,startTime,endTime,startScale,endScale,loop)
vecscale(easing,startTime,endTime,startscaleX,startscaleY,endscaleX,endscaleY,loop)
rotate(easing,startTime,endTime,startRotate,endRotate,loop)
color(easing,startTime,endTime,startR,startG,startB,endR,endG,endB,loop)
para(easing,startTime,endTime,parameter)
- parameter = "H" - Horizontal Flip, "V" - Vertical Flip, "A" - Additive
- loopCount - How many times do you want actions in the loop to repeat
- Actions that should be in this loop must have loop set to True
- Actions that should be triggered must have loop set to True
- trigger - There are many trigger options, please refer to wiki
- wav_file = Path to the song in .wav format. You can obtain it by simply converting the mp3 in Audacity to .wav or you may use original .wav.
- mi = Sets minimum scale to number you choose, that's here so many bars are not scaled to 0, this makes it usable for quiet songs
- mx = Sets maximum scale to number you choose, that's so you don't have very huge jumps, this makes it usable for loud songs
- har = Count of bars you want to generate
- start = Start time in ms
- end = End time in ms
- gap = How big gap should be between each bar (doesn't afflict spacing for circular pattern)
- posX = Explained for other commands
- posY = Explained for other commands
- layer = Explained for other commands
- origin = Explained for other commands
- arrange = "circle" or "sinus", if ignored, uses linear spectrum
- radius = Changes circle size or width of sinus
- sinheight = Changes height of sinus
When your code is done, you need to save data to some file. Put this line at the end of your code:
end("anyfileyouwant.osb")
For more reference, wiki can help you too, if you don't know what values are acceptable. If you want to report issue, be sure to PM me or use GitHub