Information:
This API is made to help people creating cool and maybe some complex sound creations without writing a lot of messy code. Furthermore this can even be programmed by non-coders if this API is bound to another functional plugin.
It has been tested for the version 1.12 and is working perfectly for me.
It uses its own parser to translate the commands from the SN-File and then executes them.
Moreover it uses its own channel system, which can be used to play single sounds or even loop them.
Every time a SN-File is used, a new run will be started.
Syntax:
You will have to create a file with a file extension 'sn'. Then you can use the syntax to write your commands to that file.
It provides eigth commands at the moment, which will be explained at this point:
INIT X;
Example: INIT 20;
Not optional
This command has to be in the first line. It will create X channels, which are used to play sounds.
TIME X;
Example: TIME 20;
Not optional
This command has to be in the second line. The new run will run for X ticks.
PLAY CHANNELID SOUND VOLUME PITCH TICK;
Example: PLAY CHANNEL8 ambient.cave 1 1 20;
Optional
ID: CHANNEL + ID
Sound: folder.folder.name [path of sound file]
This command can be used to play a single sound at a specific tick[ *].
START_LOOP CHANNELID SOUND VOLUME PITCH TICK DURATION DELAY;
Example: START_LOOP CHANNEL8 block.note.bass 1 1 20 200 10;
Optional
ID: CHANNEL + ID
Sound: folder.folder.name [path of sound file]
This command can be used to loop a sound for a specific time with a specific delay starting at a specific tick[ *].
MUTE CHANNELID TICK;
Example: MUTE CHANNEL8 100;
Optional
Mutes a specific channel at a specific tick[ *].
UNMUTE CHANNELID TICK;
Example: UNMUTE CHANNEL8 120;
Optional
Unmutes a specific channel at a specific tick[ *].
STOP_LOOP CHANNELID TICK;
Example: STOP_LOOP CHANNEL8 130;
Optional
Stops a loop from a specific channel at a specific tick[ *].
BREAK TICK;
Example: BREAK 150;
Optional
Stops the run at a specific tick[ *].
You can even use commentaries by typing:
//COMMENTARY
[ *] The first tick will be set when the run starts. That means that the 20th tick is reached 20 ticks after starting the run.
NOTE: You will get an error when you leave out a semicolon at the end of a command. The error will show you in which line you forgot the semicolon.
Implementation:
The implementation is the easiest thing about this API. It only takes three steps and you're done with the code implementation:
/**
* Manager
*/
SoundManager manager = new SoundManager ( new Instructor ( new File ( "path/file.ending" ) ) , location );
/**
* Setup
*/
manager.setup();
/**
* Start
*/
manager.start();
Use:
This API can be used to create detailed and easy-coded background music or effect sounds. There are not limits to your creativity.
Resources:
Maybe I will upload some more samples in the next few days.
https://www.file-upload.net/download-12643038/Ultimate-Intro-DenzelCurry.sn.html | Ultimate [Intro] - Denzel Curry
Hint:
Don't start a run directly after a reload or during a lag - It will also cause the timer to lag so multiple sounds can be played at once after the lag ended.
I am looking forward to questions, suggestions and implementations. :rolleyes:
Similar projects
Plugin →Let Me Despawn
Improves performance by tweaking mob despawn rules. Say bye to pesky unintentional persistent mobs.
25MSueta
JourneyMap
Real-time map used for mapping in-game or your browser as you explore.
14.7MSueta
Emotecraft
Create your own emotes in Minecraft.
7.5MSueta
Simple Tpa
A simple tpa plugin which sends requests
5.4MSueta
Common Network
Forge and Fabric Unified Networking Solution
3.9MSueta
Set Home
A lightweight plugin for players to set their homes.
3.8MSueta