Skip to main content

Note

Struct Note 

Source
pub struct Note {
    pub instrument: Instrument,
    pub key: i8,
    pub velocity: Option<i8>,
    pub panning: Option<i8>,
    pub pitch: Option<i16>,
}
Expand description

A Note is a Noteblock

Fields§

§instrument: Instrument

The instrument of the note block. This is 0-15, or higher if the song uses custom instruments.

§key: i8

The key of the note block, from 0-87, where 0 is A0 and 87 is C8. 33-57 is within the 2-octave limit.

§velocity: Option<i8>

The velocity/volume of the note block, from 0% to 100%. Only avabile in the new format version 4.

§panning: Option<i8>

The stereo position of the note block, from 0-200. 100 is center panning. Only avabile in the new format version 4.

§pitch: Option<i16>

The fine pitch of the note block in cents. The max in Note Block Studio is limited to -1200 and +1200. 0 is no fine-tuning. ±100 cents is a single semitone difference. Only avabile in the new format version 4.

Implementations§

Source§

impl Note

Source

pub fn new( instrument: Instrument, key: i8, velocity: Option<i8>, panning: Option<i8>, pitch: Option<i16>, ) -> Self

Trait Implementations§

Source§

impl Debug for Note

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl Freeze for Note

§

impl RefUnwindSafe for Note

§

impl Send for Note

§

impl Sync for Note

§

impl Unpin for Note

§

impl UnsafeUnpin for Note

§

impl UnwindSafe for Note

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.