Note Box Usage

From Homebrew Patent Unknown Wiki
Jump to navigation Jump to search
Introduction to Notes/Sounds/Music in Homebrew

New parts have brought a way to generate sounds in Homebrew ! With these you could basically make a piano if you wanted. How you can use that to interact in Homebrew and not annoy the hell out of everyone in the coming multiplayer is a whole other thing, so let's move it along. Here's how stuff works.

Note Box.png Note Box

The Note Box.

This box is what actually generates sound. If you are familiar with MIDI, audio sequencers and the likes, then you already know most of this. The Note box is a single voice (one note at a time) so if you want to do chords, you need as many Note Boxes as you need notes played all at once. There are 3 inputs and 2 adjustable settings to the Note Box.

1- Instrument:

This is what's known as the General MIDI sound bank. Pretty much every PC with a sound card has one. The quality of the actual sounds may vary depending on your sound card, but you has it. This sound bank has 128 instruments, from 0-127. Here's a basic chart of the instrument layout:

http://cs.uccs.edu/~cs525/midi/stdpatc2.jpg

So by changing that number, you can change the soundbank. By default, it will be 1, Bright Acoustic Piano. You can either change the instrument manually in the Tuner, or you can wire a value to the Instrument input and change it in-game.

2- Note.

This defines which note you are playing. You can use the Note input to change it dynamically, or you can use the Note Offset to enter one manually if it never changes. Each note has a number. Default is 0. It SHOULD be a C, but i get a slightly flat D sharp (A@440) for some reason. Anyways, for the sake of comprehension i'll stick to using C as 0. Here's another chart to give you an idea of the relation between note and numbers:

https://itp.nyu.edu/archive/physcomp-spring2014/uploads/midi/midi_screen5.png

So say i'd like to play a 3 note C major chord , i'd need 3 Note Boxes playing 0,4 and 7 respectively. This can be interesting for horns, using 2 or 3 notes and/or instruments to give it more caracter. One thing you cannot do is have an increasing/decreasing note. Notes are only whole numbers, 1.51 and 2.49 are both going to output 2. It will always have steps making it sound like sliding your fingers across a piano. Sorry, but you won't be able to use this to make that awesome engine sound you just thought you could do, it will always sound a bit weird. What you CAN do is play music. Using a Single Output Sequence Box, you can make a rudimentary MIDI sequencer and make it play songs ! More on that later...


3- Play.

This is WHEN you play the note. It acts like an on/off (play/mute) switch for the Note Box. Use 1 to play the note and 0 to mute it. It is to note (...) that this input is variable, (0.5 is quieter, 2 is louder), but not 'dynamic'. Basically, it acts like a volume, but you can't fade in or out with it. It does seem to react to how quickly the value rises up (test using smooth box), but not in a way that is usefull. BE VERY CAREFUL with this value as there doesn't seem to be an upper limit, that means you risk damaging speakers or your hearing if your volume is too high. Setting this to a value above 10-15 will introduce distortion which can be very damaging at high volumes. Ok, enough with the downer stuff, let's actually talk about how to use this and why.

There are 2 ways that i use this. One is wiring a Toggle Box to the Play input. The other is using a Single Output Sequence Box, which i will cover later. Either way, not only do you want to be able to play the note, you want to be able to shut it off, trust me. :P


So how do i make songs you say ? Well this next part is where it gets interesting....


Single Output Sequence Box.png Single Output Sequence Box

The Single Output Sequence Box.

This box allows you to set a sequence to output at a specified interval. It can be used to automate various things in Homebrew, but in our case, this can be used as your metronome, or tempo. It has one input and one output. It also has 5 settings and as many Number Outputs as you need (i'll call them steps), just add/delete them.

Input: This is the trigger to start the sequencer (if Always Run is unchecked). 0 stops it, 1 starts it. Alternatively, the Play input is variable and affects the Time Between Outputs value. 0.5 will run the sequencer at half the speed of the Time Between Outputs value and a value of 2 would run at twice the speed.

Always Run: Like it says, select this to have the sequencer always running.

Reset on Input: When you are using more than one step, selecting this means when you start it, it starts at the beginning of the sequence instead of where it stopped.

Smooth Output: This will output the values between the step values you've entered. If you have 2 steps, Number Output: 0, Number Output1: 1, then without smooth, the ouput will be 0, then 1. With smoothing on, the output will gradually output from 0 to 1. The Time Between Outputs value will define how quickly that happens. Again, using this on the Note Box's Play input will not gradually increase volume, it will most likely play quieter . Using this on the Note Box's Note input can be an interesting way to simplify stuff in a case where you'd want to play every single note between 2 specific notes.

Time Between Outputs: This is the time between the steps. Your tempo. I admit i haven't verified, but i figured this was in seconds. So that 1 would convert to 60bpm (1 second between beats = 1 beat per second = 60 beats per minute). To get 120bpm, you would use 0.5 (0.5 seconds between beats = 2 beats per second = 120bpm).

Type: RunOnce means it will play once then stop. PingPong means it will play continously, going up, then down, and so on. loop means it will play continously, playing up, then starting back at the beginning and going up again.


So to use this to make songs. First off, let me warn you that the more detail and the longer the song, the more you will need to add outputs and it can quickly get overwhelming. Try to stick to small jingle-type songs or loop one short bit of song.

First off, you'll need 2 Single Output Sequence Box. One to handle the melody and one to handle the tempo. Connect the melody sequencer's output to the Note input of your Note Box. Connect the tempo sequencer's output to a Transistor's Input and connect that Transistor's output to the Play input of that same Note Box.

A simple example would be to add a step in the tempo sequencer (click the + sign beside the Number Output to add a step). Change the second from 1 to 0, leave the first as 1. Whatever the sequence, you should add one more step and set it to 0, note off, else you risk having the last note play continuoulsy. Using a toggle box (you can connect directly to seat button too), connect toggle output to both sequencer's Play inputs AND the transistor's Trigger input. Now try it. Yay ! Your first sequence ! Well hopefully. It's hard to explain using only words and i understand some poeple will find this wall of words intimidating so at this stage i will post an example, my Dukes of Hazzard Dixie Horn: