Skip to content

Commit

Permalink
Synths - tweak chip tune synth opts
Browse files Browse the repository at this point in the history
* width_mode is now just width
* chip bass now has a note_resolution opt
* docstrings are now fixed
  • Loading branch information
samaaron committed Feb 18, 2016
1 parent c3583d6 commit 3c44c0f
Show file tree
Hide file tree
Showing 6 changed files with 268 additions and 261 deletions.
16 changes: 8 additions & 8 deletions app/server/sonicpi/lib/sonicpi/synths/synthinfo.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2597,7 +2597,7 @@ def synth_name
end

def doc
"A slightly clipped square (pulse) wave with phases of 12.5%, 25% or 50% modelled after the 2A03 chip found in voices 1 and 2 of the NES games console. This can be used for retro sounding leads and harmonised lines. This also adds a parameter 'note_slide_step' which locks the note slide to certain pitches which are multiples of the step size. This allows for emulation of the sweep setting on the 2A03."
"A slightly clipped square (pulse) wave with phases of 12.5%, 25% or 50% modelled after the 2A03 chip found in voices 1 and 2 of the NES games console. This can be used for retro sounding leads and harmonised lines. This also adds a parameter 'note_resolution' which locks the note slide to certain pitches which are multiples of the step size. This allows for emulation of the sweep setting on the 2A03."
end

def arg_defaults
Expand All @@ -2606,7 +2606,7 @@ def arg_defaults
:note_slide => 0,
:note_slide_shape => 1,
:note_slide_curve => 0,
:note_slide_step => 0.1,
:note_resolution => 0.1,
:amp => 1,
:amp_slide => 0,
:amp_slide_shape => 1,
Expand All @@ -2625,23 +2625,23 @@ def arg_defaults
:sustain_level => 1,
:env_curve => 2,

:width_mode => 0
:width => 0
}
end

def specific_arg_info
{
:width_mode =>
:width =>
{
:doc => "Which of the three pulse_widths to use - 0 => 12.5%, 1 => 25%, 2 => 50%",
:validations => [v_one_of(:width_mode, [0, 1, 2])],
:validations => [v_one_of(:width, [0, 1, 2])],
:modulatable => true,
},

:note_slide_step =>
:note_resolution =>
{
:doc => "Locks the note slide to be multiples of this (MIDI) number, producing a staircase of notes rather than a continuous line which is how things were on the NES. Set to 0 to disable.",
:validations => [v_positive(:note_slide_step)],
:doc => "Locks down the note resolution to be multiples of this (MIDI) number. For example, a `note_resolution:` of 1 will only allow semitones to be played. When used in conjunction with `note_slide:` produces a staircase of notes rather than a continuous line which is how things were on the NES. Set to 0 to disable. This wasn't a feature of this triangle (bass) channel on the original chip but some emulators have added it in since.",
:validations => [v_positive(:note_resolution)],
:modulatable => true
},
}
Expand Down
Binary file modified etc/synthdefs/compiled/sonic-pi-chipbass.scsyndef
Binary file not shown.
Binary file modified etc/synthdefs/compiled/sonic-pi-chiplead.scsyndef
Binary file not shown.
13 changes: 7 additions & 6 deletions etc/synthdefs/designs/sonic_pi/synths/chiptune.clj
Original file line number Diff line number Diff line change
Expand Up @@ -39,18 +39,18 @@
decay_level -1
sustain_level 1
env_curve 1
width_mode 0
width 0
out_bus 0]
(let [decay_level (select:kr (= -1 decay_level) [decay_level sustain_level])
note (round-down (varlag note note_slide note_slide_curve note_slide_shape) note_resolution)
freq (midicps note)
amp (varlag amp amp_slide amp_slide_curve amp_slide_shape)
amp-fudge 0.8
pan (varlag pan pan_slide pan_slide_curve pan_slide_shape)
width_mode (select:kr width_mode [0.125
0.25
0.5])
snd (softclip (pulse freq width_mode))
width (select:kr width [0.125
0.25
0.5])
snd (softclip (pulse freq width))
env (env-gen (core/shaped-adsr attack decay sustain release attack_level decay_level sustain_level env_curve) :action FREE)
snd (* amp-fudge snd env)]

Expand All @@ -61,6 +61,7 @@
note_slide 0
note_slide_shape 1
note_slide_curve 0
note_resolution 0
amp 1
amp_slide 0
amp_slide_shape 1
Expand All @@ -79,7 +80,7 @@
env_curve 1
out_bus 0]
(let [decay_level (select:kr (= -1 decay_level) [decay_level sustain_level])
note (varlag note note_slide note_slide_curve note_slide_shape)
note (round-down (varlag note note_slide note_slide_curve note_slide_shape) note_resolution)
freq (midicps note)
amp (varlag amp amp_slide amp_slide_curve amp_slide_shape)
amp-fudge 1
Expand Down
Loading

0 comments on commit 3c44c0f

Please sign in to comment.