Skip to content

Commit

Permalink
Merge pull request #262 from scarpe-team/bloopsaphone
Browse files Browse the repository at this point in the history
Bloopsaphone
  • Loading branch information
Schwad authored Jul 1, 2023
2 parents 4ea9fc9 + f9941a6 commit 67e9dc1
Show file tree
Hide file tree
Showing 12 changed files with 264 additions and 9 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ jobs:
runs-on: macos-latest
timeout-minutes: 10
steps:
- name: Install dependencies
run: brew install pkg-config portaudio
- name: Checkout code
uses: actions/checkout@v3
- name: Setup Ruby and install gems
Expand Down
17 changes: 8 additions & 9 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,20 @@ source "https://rubygems.org"
# Specify your gem's dependencies in scarpe.gemspec
gemspec

gem "bloops", "~> 0.5" #path: "../bloopsaphone" #git: "https://github.com/scarpe-team/bloopsaphone"
gem "rake", "~> 13.0"

gem "minitest", "~> 5.0"

gem "rubocop", "~> 1.21"

gem "rubocop-shopify", group: :development

gem "minitest-reporters", group: :test

gem "debug", group: :development
group :test do
gem "minitest", "~> 5.0"
gem "minitest-reporters"
end

group :development do
gem "yard"
gem "redcarpet"
gem "debug"
gem "rubocop", "~> 1.21"
gem "rubocop-shopify"
#gem "commonmarker"
#gem "github-markup"
end
File renamed without changes.
File renamed without changes.
41 changes: 41 additions & 0 deletions examples/bloopsaphone/working/bloops_test.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
require 'bloops'

# the song object
b = Bloops.new
b.tempo = 320

# an instrument
saw = b.sound Bloops::SAWTOOTH
saw.test

# assign a track to the song
b.tune saw, "c5 c6 b4 b5 d5 d6 e5 e6"

# make it go
b.play
sleep 1 while !b.stopped?

# a percussion
beat = b.sound Bloops::NOISE
beat.repeat = 0.6
beat2 = b.sound Bloops::NOISE
beat2.repeat = 0.2
beat3 = b.sound Bloops::SQUARE
beat3.sustain = 0.25
beat3.decay = 0.2
beat3.slide = 0.2
beat3.square = 0.3
beat3.vibe = 0.25
beat3.vspeed = 0.25

# assign a track to the song
b.tune beat, "4 4 4 b4 4 d5 4 e5"
b.tune beat2, "c2 4 c2 4 c2 4 c2 4"
b.tune beat3, "4 4 4 4 4 c2 c5 4"

# make it go
loop do
b.play
saw.test
sleep 0.02 while !b.stopped?
end
File renamed without changes.
210 changes: 210 additions & 0 deletions examples/bloopsaphone/working/tune_cheeky_drat.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,210 @@
#
# -)= Cheeky Drat (=-
# composed by freQvibez
# [within TextMate]
# exclusively for _why's BloopSaphone
#
# from Farbrausch with ♥
#

require 'bloops'

b = Bloops.new
b.tempo = 172

bass = b.sound Bloops::SQUARE
bass.volume = 0.4
bass.sustain = 0.1
bass.attack = 0.1
bass.decay = 0.3

base = b.sound Bloops::SQUARE
base.volume = 0.35
base.punch = 0.3
base.sustain = 0.1
base.decay = 0.3
base.phase = 0.2
base.lpf = 0.115
base.resonance = 0.55
base.slide = -0.4

snare = b.sound Bloops::NOISE
snare.attack = 0.075
snare.sustain = 0.01
snare.decay = 0.33
snare.hpf = 0.55
snare.resonance = 0.44
snare.dslide = -0.452

chord = b.sound Bloops::SQUARE
chord.volume = 0.275
chord.attack = 0.05
chord.sustain = 0.6
chord.decay = 0.9
chord.phase = 0.35
chord.psweep = -0.25
chord.vibe = 0.0455
chord.vspeed = 0.255

lead = b.sound Bloops::SINE
lead.volume = 0.45
lead.attack = 0.3
lead.sustain = 0.15
lead.decay = 0.8
lead.vibe = 0.035
lead.vspeed = 0.345
lead.vdelay = -0.5
lead.hpf = 0.2
lead.hsweep = -0.05
lead.resonance = 0.55
lead.phase = 0.4
lead.psweep = -0.05

b.tune bass, %q^
8 4a1 8a 8a 4a 4a 4c2 9c 7c 4c 8e
8 4g2 8g 8 4g 4g 4d2 8 8c3 4b2 8e
8 4d2 8c 8c 4c 4 4a2 9a 7a 4a 8a
8 4g2 8g 8 4g 4d 4d2 9e3 7c2 8 4b1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4 4a2 4 4a2 4 4a2 4 8a2 8a2
4 4a2 4 4a2 4 4a2 4 4a2
4 4a2 4 4a2 4 4a2 4 4a2
4 4a2 4 4a2 4 4a2 4 4a2
4 4a2 4 4a2 4 4a2 4 8a2 8a2
4 4a2 4 4a2 4 4a2 4 4a2
4 4a2 4 4a2 4 4a2 4 4a2
4 4a2 4 4a2 4 4a2 4 4a2
4 4a2 4 4a2 4 4a2 4 8a2 8a2
^

b.tune chord, %q^
1
1 1
1 1 1
1 1
1a2 2a3 2 1g2 2d3 2
1a2 2a3 2 1d2 4g3 4g2 2e3
1a2 2a3 2 1g2 2d3 2
1a2 2a3 2 1d2 2g3 2
1a2 2a3 2 1g2 2d3 2
1a2 2a3 2 1d2 2g3 2
1a2 2a3 2 1g2 2d3 2
1a2 2a3 2 1d2 2g3 2
^

b.tune chord, %q^
1
1 1
1 1 1
1 1
2 2c4 2 1 2b4 2
1 2c4 4 2g3 2b4 1
2 2c4 2 1 2b4 2
1 2c4 2 1 2b4 1
2 2c4 2 1 2b4 2
1 2c4 2 1 2b4 1
2 2c4 2 1 2b4 2
1 2c4 2 1 2b4 1
^

b.tune chord, %q^
1
1 1
1 1 1
1 1
2 1 2e4 2 1 2d4
2 1 2e4 2 1 2d4
2 1 2e4 2 1 2d4
2 1 2e4 2 1 2d4
2 1 2e4 2 1 2d4
2 1 2e4 2 1 2d4
2 1 2e4 2 1 2d4
2 1 2e4 2 1 2d4
^

b.tune lead, %q^
1 4
1 1 1 1
1 1 1 1 1 1
1 1 1 1
2g3 1a4 2
2c5 1e4 2 1
1a4 2 4 2e4 1d4 2
2a3 1b4 2
2d5 2g4 1c5
1a4 1e5
1b4 2 4 8 8d4
2g3 1a4 2
2c5 1e4 3d4 5g4
1a4 1e4
1d4 1
^

while true do
b.play
sleep 0.5 while not b.stopped?
end
2 changes: 2 additions & 0 deletions lib/scarpe.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ class Scarpe::Error < StandardError; end
require_relative "scarpe/display_service"
require_relative "scarpe/widgets"

require "bloops"

d_s = ENV["SCARPE_DISPLAY_SERVICE"] || "wv_local"
# This is require, not require_relative, to allow gems to supply a new display service
require "scarpe/#{d_s}"
Expand Down
1 change: 1 addition & 0 deletions test/test_examples.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ class TestExamplesWithWebview < LoggedScarpeTest
examples_to_test = Dir["examples/**/*.rb"]
.reject { !_1.include?(match_str) }
.reject { _1.include?("/not_checked/") }
.reject { _1.include?("/bloopsaphone/") } # How do we want to CI-check these?
.reject { _1.include?("/skip_ci/") if ENV["CI_RUN"] }

examples_to_test.each do |example_filename|
Expand Down

0 comments on commit 67e9dc1

Please sign in to comment.